diff --git a/attributes/default.rb b/attributes/default.rb index 515bc0f..4d216d2 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -19,7 +19,7 @@ default['chef_software']['chef_server_api_fqdn'] = 'chef-server.example.com' default['chef_software']['chef_automate_api_fqdn'] = 'chef-automate.example.com' default['chef_software']['chef_supermarket_api_fqdn'] = 'chef-supermarket.example.com' -default['chef_software']['automate_admin_token'] = lazy { kitchen? ? shell_out("chef-automate iam token create test_user --admin").stdout.strip : nil } +default['chef_software']['automate_admin_token'] = kitchen? ? shell_out("chef-automate iam token create test_user --admin").stdout.strip : nil default['chef_software']['chef_automatev2'] = { products: %w(automate infra-server builder), diff --git a/recipes/chef_automatev2.rb b/recipes/chef_automatev2.rb index d2ee983..75223f7 100644 --- a/recipes/chef_automatev2.rb +++ b/recipes/chef_automatev2.rb @@ -25,7 +25,7 @@ node['chef_software']['automatev2_local_users']&.each do |name, hash| iam_user name do user_hash hash['user_json'] - api_token node['chef_software']['automate_admin_token'] + api_token lazy { node['chef_software']['automate_admin_token'] } action :create end end @@ -33,7 +33,7 @@ node['chef_software']['automatev2_iam_policies']&.each do |name, hash| iam_policy name do policy_hash hash['policy_json'] - api_token node['chef_software']['automate_admin_token'] + api_token lazy { node['chef_software']['automate_admin_token'] } action :create end end