Skip to content

Commit

Permalink
update csr_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaffen committed Apr 18, 2024
1 parent 7cf7786 commit 181377c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions puppetserver/docker-entrypoint.d/89-csr_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

begin
csr_yaml = YAML.dump(JSON.load(ENV['CSR_ATTRIBUTES']))
File.open('/etc/puppetlabs/puppet/csr_attributes.yaml', 'w') do |file|
file.write(csr_yaml)
end
File.write('/etc/puppetlabs/puppet/csr_attributes.yaml', csr_yaml)
rescue => error
puts "Error on reading JSON env. Terminating"
puts "Malformed JSON: #{ENV['CSR_ATTRIBUTES']}"
p error.message
exit 99
end
2 changes: 1 addition & 1 deletion puppetserver/docker-entrypoint.d/89-csr_attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

set -e

echo $CSR_ATTRIBUTES
echo "CSR Attributes: ${CSR_ATTRIBUTES}"
/opt/puppetlabs/puppet/bin/ruby /docker-entrypoint.d/89-csr_attributes.rb

0 comments on commit 181377c

Please sign in to comment.