Below is just an example
logstash_cert_secret = Chef::EncryptedDataBagItem.load_secret("/etc/chef/secrets/logstash_client_key")
logstash_certs = Chef::EncryptedDataBagItem.load("certs", "logstash_client", logstash_cert_secret)
directory "/etc/pki/tls/certs/" do
action :create
mode "0755"
owner "root"
group "root"
end
file "/etc/pki/tls/certs/logstash_client.crt" do
action :create
mode "0644"
owner "root"
group "root"
content logstash_certs["crt"].join("")
end
No comments:
Post a Comment