config_o_mat 0.5.8 → 0.5.9
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/CLAUDE.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/config_o_mat/configurator/op/generate_all_templates.rb +48 -25
- data/lib/config_o_mat/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15e76f13156e85ee17c2ae59bc5036e7ed302d629ddddf6f8db3418b6286e8ac
|
|
4
|
+
data.tar.gz: ed5355b83c9c175c2944c207a9508ee6785fe7d64c875c11b14ea7d1416f00bf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a77dd6303c4b7ec2e8adcc655efd9adc2645557d537e88ad786efbf551f5bd659012db06cffa8f93bb8b0e8e29e8ebb9a9601644c5cfa32c7baf831917a598a9
|
|
7
|
+
data.tar.gz: a2b3c793e12cafba0f5363d2d998ebff757054097800c377452d8273dd87f6d9af9531d5423053da258dbb6eb58f5cc0e94cc0778e4caf7f7dd289b99d7ea010
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 0.5.9
|
|
2
|
+
|
|
3
|
+
BUG FIXES:
|
|
4
|
+
|
|
5
|
+
* A running configurator that fails to parse or render a new AppConfig profile version logs `profile_render_failed` at
|
|
6
|
+
`error`, with `application`, `environment`, `appconfig_profile`, `profile` and `profile_version`, then exits as
|
|
7
|
+
before. It's logged only while a new version is being applied, not on a first run, and never for facter or S3
|
|
8
|
+
fallback profiles.
|
|
9
|
+
* Templates are written only once all of them render, so a failure leaves every output file as it was.
|
|
10
|
+
|
|
1
11
|
## 0.5.8
|
|
2
12
|
|
|
3
13
|
BUG FIXES:
|
data/CLAUDE.md
CHANGED
|
@@ -110,6 +110,9 @@ The Configurator VM includes retry logic:
|
|
|
110
110
|
- After first run, failures trigger retry with exponential backoff
|
|
111
111
|
- Configurable via `retry_count` and `retry_wait` in config files
|
|
112
112
|
- Failed profile refreshes can roll back to previous working version
|
|
113
|
+
- A render failure while applying a new AppConfig version logs `profile_render_failed` (application, environment,
|
|
114
|
+
appconfig_profile, profile, profile_version) before the VM errors. Not logged on first run, or for facter or S3
|
|
115
|
+
fallback profiles
|
|
113
116
|
|
|
114
117
|
### Secrets Integration
|
|
115
118
|
|
data/Gemfile.lock
CHANGED
|
@@ -20,47 +20,70 @@ module ConfigOMat
|
|
|
20
20
|
module Op
|
|
21
21
|
class GenerateAllTemplates < LifecycleVM::OpBase
|
|
22
22
|
reads :template_defs, :dependencies, :applied_profiles, :applying_profile, :generated_templates,
|
|
23
|
-
:compiled_templates, :runtime_directory
|
|
23
|
+
:compiled_templates, :runtime_directory, :profile_defs
|
|
24
24
|
|
|
25
25
|
writes :generated_templates, :services_to_reload
|
|
26
26
|
|
|
27
27
|
def call
|
|
28
|
-
# By doing the error check here instead of in StageOneProfile we ensure that the applying_profile
|
|
29
|
-
# gets set in memory, even if errored, which simplifies the retry logic.
|
|
30
|
-
error applying_profile.name, applying_profile.errors if applying_profile&.errors?
|
|
31
|
-
|
|
32
|
-
return if errors?
|
|
33
|
-
|
|
34
|
-
profiles = applied_profiles
|
|
35
|
-
profiles[applying_profile.name] = applying_profile if applying_profile
|
|
36
28
|
self.services_to_reload = []
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
failures = {}
|
|
31
|
+
# Checked here rather than in StageOneProfile so a profile that failed to parse is still the
|
|
32
|
+
# applying_profile, which simplifies the retry logic.
|
|
33
|
+
failures[applying_profile.name] = applying_profile.errors if applying_profile&.errors?
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
rendered = compiled_template.render(profiles)
|
|
43
|
-
rescue StandardError => e
|
|
44
|
-
error key, e
|
|
45
|
-
next
|
|
46
|
-
end
|
|
35
|
+
rendered = failures.empty? ? render_all(failures) : {}
|
|
47
36
|
|
|
48
|
-
|
|
37
|
+
unless failures.empty?
|
|
38
|
+
log_render_failure(failures) if applying_profile
|
|
39
|
+
failures.each { |(key, err)| error key, err }
|
|
40
|
+
return
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Only write once every template has rendered, so a failure leaves all output as it was.
|
|
44
|
+
rendered.each do |(key, contents)|
|
|
45
|
+
generated = GeneratedTemplate.new(contents)
|
|
46
|
+
next if generated_templates[key] == generated
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
logger&.notice(:template_update, template: key, file: destination_file, digest: generated.digest)
|
|
48
|
+
destination_file = File.join(runtime_directory, template_defs[key].dst)
|
|
49
|
+
logger&.notice(:template_update, template: key, file: destination_file, digest: generated.digest)
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
end
|
|
51
|
+
generated_templates[key] = generated
|
|
52
|
+
File.open(destination_file, 'w') { |f| f.write(contents) }
|
|
53
|
+
dependencies[key]&.each { |service| services_to_reload << service }
|
|
58
54
|
end
|
|
59
55
|
|
|
60
56
|
services_to_reload.uniq!
|
|
61
57
|
|
|
62
58
|
logger&.notice(:scheduled_restarts, services: services_to_reload)
|
|
63
59
|
end
|
|
60
|
+
|
|
61
|
+
private
|
|
62
|
+
|
|
63
|
+
def render_all(failures)
|
|
64
|
+
profiles = applied_profiles
|
|
65
|
+
profiles[applying_profile.name] = applying_profile if applying_profile
|
|
66
|
+
|
|
67
|
+
template_defs.each_key.with_object({}) do |key, rendered|
|
|
68
|
+
rendered[key] = compiled_templates[key].render(profiles)
|
|
69
|
+
rescue StandardError => e
|
|
70
|
+
failures[key] = e
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Only AppConfig-served versions log it: facter and S3-fallback failures can't be fixed by rolling back a
|
|
75
|
+
# deployment, so they must never trip the rollback alarm.
|
|
76
|
+
def log_render_failure(failures)
|
|
77
|
+
definition = profile_defs&.fetch(applying_profile.name, nil)
|
|
78
|
+
return unless definition.is_a?(ConfigOMat::Profile) && !applying_profile.fallback?
|
|
79
|
+
|
|
80
|
+
logger&.error(
|
|
81
|
+
:profile_render_failed,
|
|
82
|
+
application: definition.application, environment: definition.environment,
|
|
83
|
+
appconfig_profile: definition.profile, profile: applying_profile.name,
|
|
84
|
+
profile_version: applying_profile.version, errors: failures.transform_values(&:to_s)
|
|
85
|
+
)
|
|
86
|
+
end
|
|
64
87
|
end
|
|
65
88
|
end
|
|
66
89
|
end
|
data/lib/config_o_mat/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +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.
|
|
4
|
+
version: 0.5.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Scarborough
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-12-04 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: aws-sdk-appconfig
|
|
@@ -169,6 +170,7 @@ dependencies:
|
|
|
169
170
|
- - "~>"
|
|
170
171
|
- !ruby/object:Gem::Version
|
|
171
172
|
version: '3.10'
|
|
173
|
+
description:
|
|
172
174
|
email:
|
|
173
175
|
- alex@teak.io
|
|
174
176
|
executables:
|
|
@@ -262,6 +264,7 @@ licenses: []
|
|
|
262
264
|
metadata:
|
|
263
265
|
homepage_uri: https://github.com/GoCarrot/configurator
|
|
264
266
|
source_code_uri: https://github.com/GoCarrot/configurator
|
|
267
|
+
post_install_message:
|
|
265
268
|
rdoc_options: []
|
|
266
269
|
require_paths:
|
|
267
270
|
- lib
|
|
@@ -276,7 +279,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
276
279
|
- !ruby/object:Gem::Version
|
|
277
280
|
version: '0'
|
|
278
281
|
requirements: []
|
|
279
|
-
rubygems_version: 3.
|
|
282
|
+
rubygems_version: 3.5.22
|
|
283
|
+
signing_key:
|
|
280
284
|
specification_version: 4
|
|
281
285
|
summary: ConfigOMat applies AWS AppConfig to Systemd services.
|
|
282
286
|
test_files: []
|