summaryrefslogtreecommitdiff
path: root/kitchen-tests/cookbooks/end_to_end/recipes/chef-vault.rb
blob: 407a54cd738c9b13a00cfa12d71930d2a63dad6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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