Skip to content

Commit

Permalink
Added chef data bag item
Browse files Browse the repository at this point in the history
  • Loading branch information
directdevops committed Jan 30, 2021
1 parent e017e9e commit 5cad0ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
15 changes: 14 additions & 1 deletion Jan21/chef-repo/cookbooks/ltutils/recipes/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,17 @@
action :install
end

end
end

secret = data_bag_item('tomcat', 'tomcatusers', 'learningthoughts')
username = secret['username']
password = secret['password']

log username do
level :info
end

log password do
level :info
end

18 changes: 15 additions & 3 deletions Jan21/chef-repo/data_bags/tomcat/tomcatusers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{
"id": "tomcatusers",
"username": "tomcat",
"password": "tomcat"
"id": "tomcatusers",
"username": {
"encrypted_data": "zmSmYrcUnA6xHteEJ8DlllFlKYnme+jQtQ==\n",
"iv": "aFjqR5Mvyv1e55XU\n",
"auth_tag": "y+TuC2VkacKE2ajTzIuFxQ==\n",
"version": 3,
"cipher": "aes-256-gcm"
},
"password": {
"encrypted_data": "HU0RYGDgCsrcbJgyAzM7Zvn5S5whCyb5iQ==\n",
"iv": "s+oi1JCUSFbBbKE8\n",
"auth_tag": "pH8cTkoVklA7hbJqZWI43A==\n",
"version": 3,
"cipher": "aes-256-gcm"
}
}

0 comments on commit 5cad0ad

Please sign in to comment.