Skip to content

Instantly share code, notes, and snippets.

@hh
Created September 10, 2014 20:33
Show Gist options
  • Save hh/ef18b052840c5a9d3d83 to your computer and use it in GitHub Desktop.
Save hh/ef18b052840c5a9d3d83 to your computer and use it in GitHub Desktop.
# A data bag secret lets us use secret ingredients
encrypted_data_bag_secret_file = "#{current_dir}/encrypted_data_bag_secret"
if not ::File.exists? encrypted_data_bag_secret_file
open(encrypted_data_bag_secret_file,'w') do |secretkeyfile|
secretkeyfile.write(OpenSSL::PKey::RSA.new(512).to_pem.lines.to_a[1..-2].join.chomp)
end
end
encrypted_data_bag_secret = encrypted_data_bag_secret_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment