File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -84,29 +84,17 @@ jobs:
84
84
FILE='spec/fixtures/litmus_inventory.yaml'
85
85
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
86
86
87
- - name : Inject PE vars into inventory (Ruby, safe )
87
+ - name : Inject PE postgres_version into inventory (Ruby, minimal )
88
88
shell : bash
89
89
run : |
90
90
FILE='spec/fixtures/litmus_inventory.yaml'
91
-
92
- # Use Ruby to safely modify YAML: redact ssh.password and add PE Postgres version under vars
93
91
ruby - "$FILE" <<'RUBY'
94
92
require 'yaml'
95
93
file = ARGV[0]
96
94
inv = YAML.load_file(file)
97
95
98
- unless inv.is_a?(Hash) && inv.key?('groups')
99
- raise "Unexpected inventory structure: #{inv.class}"
100
- end
101
-
102
96
(inv['groups'] || []).each do |g|
103
97
(g['targets'] || []).each do |t|
104
- # Redact SSH password if present
105
- if (ssh = t.dig('config', 'ssh'))
106
- ssh['password'] = '[redacted]' if ssh.key?('password')
107
- end
108
-
109
- # Ensure vars exist and inject desired PE param
110
98
t['vars'] ||= {}
111
99
t['vars']['puppet_enterprise::params::postgres_version'] = '13'
112
100
end
@@ -115,10 +103,6 @@ jobs:
115
103
File.write(file, inv.to_yaml)
116
104
RUBY
117
105
118
- echo "::group::litmus_inventory.yaml (after injection)"
119
- cat "$FILE"
120
- echo "::endgroup::"
121
-
122
106
- name : Install PE
123
107
run : |
124
108
bundle exec bolt --modulepath spec/fixtures/modules -i ./spec/fixtures/litmus_inventory.yaml plan run ntp::acceptance::pe_server
You can’t perform that action at this time.
0 commit comments