diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-02-12 17:46:59 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-02-12 19:29:44 -0800 |
commit | 19163410401c224dfaba82d288482528773f530e (patch) | |
tree | 38c7b4e7751ac361fef553af83d600ffc61a56eb /kitchen-tests/cookbooks | |
parent | 60931752176e409b25e90d853376e5d8ee9d500f (diff) | |
download | chef-19163410401c224dfaba82d288482528773f530e.tar.gz |
Add a Kitchen Test for chef_vault_secret
Pulled from the cookbook. I also sprinkled some chef-utils usage on the existing test.
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'kitchen-tests/cookbooks')
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb | 32 | ||||
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/default.rb | 6 |
2 files changed, 36 insertions, 2 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb b/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb new file mode 100644 index 0000000000..504a91da2b --- /dev/null +++ b/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb @@ -0,0 +1,32 @@ +# +# Cookbook:: end_to_end +# Recipe:: chef-vault +# +# Copyright:: 2020, Chef Software, Inc. +# + +chef_data_bag 'creds' + +openssl_rsa_private_key '/root/bob_bobberson.pem' do + key_length 2048 + action :create +end + +chef_client 'bob_bobberson' do + source_key_path '/root/bob_bobberson.pem' +end + +chef_node 'bob_bobberson' + +chef_vault_secret 'super_secret_1' do + data_bag 'creds' + raw_data('auth' => '1234') + admins 'bob_bobberson' + search '*:*' +end + +chef_vault_secret 'super_secret_2' do + data_bag 'creds' + raw_data('auth' => '4321') + admins 'bob_bobberson' +end
\ No newline at end of file diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb index 0af35f8c7a..6202efcc68 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/default.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/default.rb @@ -2,7 +2,7 @@ # Cookbook:: end_to_end # Recipe:: default # -# Copyright:: 2014-2019, Chef Software Inc. +# Copyright:: 2014-2020, Chef Software Inc. # hostname "chef-bk-ci.chef.io" @@ -33,7 +33,7 @@ yum_repository "epel" do gpgkey "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{node["platform_version"].to_i}" gpgcheck true mirrorlist "https://mirrors.fedoraproject.org/metalink?repo=epel-#{node["platform_version"].to_i}&arch=$basearch" - only_if { platform_family?("rhel") } + only_if { rhel? } end build_essential do @@ -118,4 +118,6 @@ end end end +include_recipe "::chef-vault" unless includes_recipe?("end_to_end::chef-vault") + include_recipe "::tests" |