- From:
- To: chef <
>
- Subject: [chef] restoring lost encrypted data bag item entries
- Date: Fri, 1 Mar 2013 23:42:57 +0000
likely due to not having a YAML engine config in my knife.rb on one of my
systems, i think i caused some contents to drop out of one of my encrypted
data bags.
missing in knife.rb: YAML::ENGINE.yamler = 'syck' if RUBY_VERSION > '1.9'
[ops:master chef-repo]$ knife data bag show secrets --secret-file
~/.chef/encrypted_data_bag_secret -Fj db-item | grep X509
"FOO_X509_PRIVATEKEY": "",
"FOO_X509_SERVERCERT": "",
i do have the data bag item contents committed to git in encrypted form:
[ops:master chef-repo]$ grep FOO data_bags/secrets/db-item.json
"FOO_X509_SERVERCERT": "redacted\n",
"FOO_X509_PRIVATEKEY": "redacted\n",
how could i use ~/.chef/encrypted_data_bag_secret to decrypt the contents of
the file in git to restore the full data bag contents to the chef server?
i suspect there's some openssl or gpg or library incantantion to do this.
i just don't know what.
if can get the decrypted contents into a json file, i'd then restore using:
knife data bag from file --secret-file ~/.chef/encrypted_data_bag_secret
secrets decrypted.json
thanks!
kallen
- [chef] restoring lost encrypted data bag item entries, kallen, 03/01/2013
Archive powered by MHonArc 2.6.16.