Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Write secret key file and then reference it
get_file = ruby_block "get_file" do
block do
conn = Some::Remote.new("param")
remoteFile = conn.get("/path/to/file")
localFile = File.open("/tmp/test_secret_key",'w')
localFile.write(remoteFile.contents)
end
not_if { ::File.exists?("/tmp/test_secret_key") }
action :nothing
end
get_file.run_action(:create)
secret_key = Chef::EncryptedDataBagItem.load_secret("/tmp/test_secret_key")
# Fails: invalid zero length secret in "/tmp/test_secret_key"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.