Skip to content

Instantly share code, notes, and snippets.

@Fodoj
Created May 2, 2015 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fodoj/2a88bd8c0417320eea4e to your computer and use it in GitHub Desktop.
Save Fodoj/2a88bd8c0417320eea4e to your computer and use it in GitHub Desktop.
secret = Chef::EncryptedDataBagItem.load_secret(Chef::Config[:encrypted_data_bag_secret])
secrets_bag = Chef::EncryptedDataBagItem.load('app-secrets', node['app']['name'], secret)
secrets_bag.to_hash.each do |key, value|
node.default['app'][key] = case value
when Hash
Chef::Mixin::DeepMerge.merge(node['app'][key], value)
else
value
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment