Created
October 21, 2013 12:03
-
-
Save brettcave/7082764 to your computer and use it in GitHub Desktop.
Write secret key file and then reference it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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