diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 059a917..eeee15a 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -22,10 +22,16 @@ def prefix def ensurekv(config, hash) hash.each do |k, v| + if v.is_a?(Symbol) + v = v.to_s + str = v + else + str = "'#{v}'" + end if config =~ /^ *#{v}.*$/ - config.sub(/^ *#{v}.*$/, "#{k} '#{v}'") + config.sub(/^ *#{v}.*$/, "#{k} #{str}") else - config << "\n#{k} '#{v}'" + config << "\n#{k} #{str}" end end config diff --git a/metadata.rb b/metadata.rb index 4c2436c..550b46a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,6 +7,6 @@ long_description 'Resource Cookbook for Managing Chef Software Inc Product Suite' issues_url 'https://github.com/ncerny/chef_stack/issues' if respond_to?(:issues_url) source_url 'https://github.com/ncerny/chef_stack' if respond_to?(:source_url) -version '0.6.3' +version '0.8.0' depends 'chef-ingredient' diff --git a/resources/wf_builder.rb b/resources/wf_builder.rb index 129ebf7..246885f 100644 --- a/resources/wf_builder.rb +++ b/resources/wf_builder.rb @@ -118,7 +118,7 @@ file "#{workspace}/#{dir}" do content ensurekv(::File.read(new_resource.chef_config_path), node_name: new_resource.chef_user, - log_location: 'STDOUT', + log_location: :STDOUT, client_key: "#{workspace}/#{dir}/#{new_resource.chef_user}.pem", trusted_certs_dir: '/etc/chef/trusted_certs') mode '0644'