config_o_mat 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f95d6871d5b5bb42f5c48900cd449e6b5cb899dbe2457ce9461b51e52893bd0
4
- data.tar.gz: ef07242ebd3cc3ab3c79a047e5574567821a528d9661953eb65fa0fd9a61ee61
3
+ metadata.gz: ab3fb3f2169c4bc1cda555a516de6ca07434870eceb4da1a69ae76a309fd4bb2
4
+ data.tar.gz: 79cdff6227b77cf747eb33cd3b08a2031c0657347f69e2e3e335fcf6a2b61146
5
5
  SHA512:
6
- metadata.gz: ebf154bdf525fdc70a3d5f447a3485eee808e790da404a77b2be5da0a0700986fd0724f1a6fa245dcc12afadf0082fcab8d248f49802c4d68676b881fe2fbecc
7
- data.tar.gz: 67c3561c1ec2b839ba343fb04bc71c2886ead05e81d888ca031d1fd42b3105984cc055fec6341a2447de032f821a1e4b70305d671bb371249d0526efb8dc9605
6
+ metadata.gz: '08ed12b4a0aa016b8fe9f003219bfa7f8a01ff6d3e9cfdc12ee6b7238d3648a59472825b93abfbcaf1df0ffb9173207184f2953850c0f617d22e24210fdb6412'
7
+ data.tar.gz: 991b84dcbad406faa7da15775f0c8aa0ea5454a6cfbcdaa221309edc7eeca3e6cf8df2081fc481db6ca9371873afc8c49555df49878995f1456e9412755345c2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.5.2
2
+
3
+ * Rerelease of 0.5.1 with merged PRs.
4
+
5
+ ## 0.5.1
6
+
7
+ ENHANCEMENTS:
8
+
9
+ * Added restart_mode: none, to prevent service restarts on a configuration update.
10
+
1
11
  ## 0.5.0
2
12
 
3
13
  NEW FEATURES:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- config_o_mat (0.4.4)
4
+ config_o_mat (0.5.2)
5
5
  aws-sdk-appconfig (~> 1.18)
6
6
  aws-sdk-s3 (~> 1.114)
7
7
  aws-sdk-secretsmanager (~> 1.57)
@@ -15,30 +15,30 @@ GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
17
  aws-eventstream (1.2.0)
18
- aws-partitions (1.593.0)
19
- aws-sdk-appconfig (1.25.0)
18
+ aws-partitions (1.615.0)
19
+ aws-sdk-appconfig (1.26.0)
20
20
  aws-sdk-core (~> 3, >= 3.127.0)
21
21
  aws-sigv4 (~> 1.1)
22
- aws-sdk-core (3.131.1)
22
+ aws-sdk-core (3.131.6)
23
23
  aws-eventstream (~> 1, >= 1.0.2)
24
24
  aws-partitions (~> 1, >= 1.525.0)
25
25
  aws-sigv4 (~> 1.1)
26
26
  jmespath (~> 1, >= 1.6.1)
27
- aws-sdk-kms (1.57.0)
27
+ aws-sdk-kms (1.58.0)
28
28
  aws-sdk-core (~> 3, >= 3.127.0)
29
29
  aws-sigv4 (~> 1.1)
30
30
  aws-sdk-s3 (1.114.0)
31
31
  aws-sdk-core (~> 3, >= 3.127.0)
32
32
  aws-sdk-kms (~> 1)
33
33
  aws-sigv4 (~> 1.4)
34
- aws-sdk-secretsmanager (1.62.0)
34
+ aws-sdk-secretsmanager (1.64.0)
35
35
  aws-sdk-core (~> 3, >= 3.127.0)
36
36
  aws-sigv4 (~> 1.1)
37
- aws-sigv4 (1.5.0)
37
+ aws-sigv4 (1.5.1)
38
38
  aws-eventstream (~> 1, >= 1.0.2)
39
39
  diff-lcs (1.5.0)
40
40
  docile (1.4.0)
41
- facter (4.2.10)
41
+ facter (4.2.11)
42
42
  hocon (~> 1.3)
43
43
  thor (>= 1.0.1, < 2.0)
44
44
  hocon (1.3.1)
@@ -36,7 +36,6 @@ module ConfigOMat
36
36
  def refresh_facter_profile
37
37
  profile_name = applying_profile.name
38
38
  profile_version = applying_profile.version
39
- definition = profile_defs[profile_name]
40
39
  new_profile = ConfigOMat::LoadedFacterProfile.new(profile_name)
41
40
 
42
41
  if new_profile.version == profile_version
@@ -33,6 +33,11 @@ module ConfigOMat
33
33
 
34
34
  if restart_mode == :restart || restart_mode == :restart_all
35
35
  do_restart(service, service_def)
36
+ elsif restart_mode == :none
37
+ logger&.notice(
38
+ :skipped_service_restart,
39
+ name: service, systemd_unit: service_def.systemd_unit
40
+ )
36
41
  else
37
42
  do_flip_flop(service, service_def)
38
43
  end
@@ -21,6 +21,8 @@ require 'yaml'
21
21
  require 'digest'
22
22
 
23
23
  module ConfigOMat
24
+ PRESENCE_ERROR_MSG = 'must be present'
25
+
24
26
  class LogWriter
25
27
  def call(level_name, event_type, merged_data)
26
28
  merged_data[:level] = level_name
@@ -87,7 +89,7 @@ module ConfigOMat
87
89
  end
88
90
 
89
91
  class Service < ConfigItem
90
- RESTART_MODES = %i[restart flip_flop restart_all].freeze
92
+ RESTART_MODES = %i[restart flip_flop restart_all none].freeze
91
93
 
92
94
  attr_reader :systemd_unit, :restart_mode, :templates, :restart_unit
93
95
 
@@ -108,11 +110,11 @@ module ConfigOMat
108
110
  end
109
111
 
110
112
  def validate
111
- error :templates, 'must be present' if @templates.nil? || @templates.empty?
113
+ error :templates, PRESENCE_ERROR_MSG if @templates.nil? || @templates.empty?
112
114
  unless @templates.is_a?(Array) && @templates.all? { |v| v.is_a?(String) }
113
115
  error :templates, 'must be an array of strings'
114
116
  end
115
- error :systemd_unit, 'must be present' if @systemd_unit.nil? || @systemd_unit.empty? || @systemd_unit == '@'
117
+ error :systemd_unit, PRESENCE_ERROR_MSG if @systemd_unit.nil? || @systemd_unit.empty? || @systemd_unit == '@'
116
118
  error :restart_mode, "must be one of #{RESTART_MODES}" unless RESTART_MODES.include?(@restart_mode)
117
119
 
118
120
  if @restart_mode == :flip_flop && !@systemd_unit.end_with?('@')
@@ -148,8 +150,8 @@ module ConfigOMat
148
150
  end
149
151
 
150
152
  def validate
151
- error :src, 'must be present' if @src.nil? || @src.empty?
152
- error :dst, 'must be present' if @dst.nil? || @dst.empty?
153
+ error :src, PRESENCE_ERROR_MSG if @src.nil? || @src.empty?
154
+ error :dst, PRESENCE_ERROR_MSG if @dst.nil? || @dst.empty?
153
155
  end
154
156
 
155
157
  def hash
@@ -174,9 +176,9 @@ module ConfigOMat
174
176
  end
175
177
 
176
178
  def validate
177
- error :application, 'must be present' if @application.nil? || @application.empty?
178
- error :environment, 'must be present' if @environment.nil? || @environment.empty?
179
- error :profile, 'must be present' if @profile.nil? || @profile.empty?
179
+ error :application, PRESENCE_ERROR_MSG if @application.nil? || @application.empty?
180
+ error :environment, PRESENCE_ERROR_MSG if @environment.nil? || @environment.empty?
181
+ error :profile, PRESENCE_ERROR_MSG if @profile.nil? || @profile.empty?
180
182
  if !@s3_fallback.nil?
181
183
  if @s3_fallback.kind_of?(String)
182
184
  error :s3_fallback, 'must be non-empty' if @s3_fallback.empty?
@@ -225,8 +227,8 @@ module ConfigOMat
225
227
  end
226
228
 
227
229
  def validate
228
- error :name, 'must be present' if @name.nil? || @name.empty?
229
- error :contents, 'must be present' if @contents.nil? || @contents.empty?
230
+ error :name, PRESENCE_ERROR_MSG if @name.nil? || @name.empty?
231
+ error :contents, PRESENCE_ERROR_MSG if @contents.nil? || @contents.empty?
230
232
  error :contents, 'must be a hash' if !@contents.kind_of?(Hash)
231
233
  end
232
234
 
@@ -320,10 +322,10 @@ module ConfigOMat
320
322
  end
321
323
 
322
324
  def validate
323
- error :name, 'must be present' if @name.nil? || @name.empty?
325
+ error :name, PRESENCE_ERROR_MSG if @name.nil? || @name.empty?
324
326
  error :name, 'must be a Symbol' unless @name.is_a?(Symbol)
325
- error :version, 'must be present' if @version.nil? || @version.empty?
326
- error :contents, 'must be present' if @contents.nil? || @contents.empty?
327
+ error :version, PRESENCE_ERROR_MSG if @version.nil? || @version.empty?
328
+ error :contents, PRESENCE_ERROR_MSG if @contents.nil? || @contents.empty?
327
329
  end
328
330
 
329
331
  def hash
@@ -392,7 +394,7 @@ module ConfigOMat
392
394
  end
393
395
 
394
396
  def validate
395
- error :secret_id, 'must be present' if @secret_id.nil? || @secret_id.empty?
397
+ error :secret_id, PRESENCE_ERROR_MSG if @secret_id.nil? || @secret_id.empty?
396
398
  error :content_type, "must be one of #{VALID_CONTENT_TYPES}" unless VALID_CONTENT_TYPES.include?(@content_type)
397
399
  end
398
400
 
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module ConfigOMat
18
- VERSION = "0.5.0"
18
+ VERSION = "0.5.2"
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: config_o_mat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Scarborough
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-appconfig