diff options
author | dheerajd-msys <dheeraj.dubey@msystechnologies.com> | 2019-01-17 16:15:46 +0530 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-03-04 09:46:49 -0800 |
commit | 12ad5791dfca9a0eb05f093e9cf2c8f70c73cdbd (patch) | |
tree | b7b4eb655d86f7d932c86dca6d475d2120e956ad /lib/chef/resource | |
parent | 2e097cebbe9c2c6a3e078fd51941eb2822772a44 (diff) | |
download | chef-12ad5791dfca9a0eb05f093e9cf2c8f70c73cdbd.tar.gz |
update property for existing file
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/openssl_dhparam.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/chef/resource/openssl_dhparam.rb b/lib/chef/resource/openssl_dhparam.rb index aa65d5792c..581ac8f3b7 100644 --- a/lib/chef/resource/openssl_dhparam.rb +++ b/lib/chef/resource/openssl_dhparam.rb @@ -57,17 +57,27 @@ class Chef action :create do description "Create the dhparam file." + unless dhparam_pem_valid?(new_resource.path) + converge_by("Create a dhparam file #{new_resource.path}") do + dhparam_content = gen_dhparam(new_resource.key_length, new_resource.generator).to_pem - converge_by("Create a dhparam file #{new_resource.path}") do - dhparam_content = gen_dhparam(new_resource.key_length, new_resource.generator).to_pem if !::File.exist?(new_resource.path) - + file new_resource.path do + action :create + owner new_resource.owner unless new_resource.owner.nil? + group new_resource.group unless new_resource.group.nil? + mode new_resource.mode + sensitive true + content dhparam_content + end + end + end + if ::File.exist?(new_resource.path) file new_resource.path do action :create owner new_resource.owner unless new_resource.owner.nil? group new_resource.group unless new_resource.group.nil? mode new_resource.mode sensitive true - content dhparam_content end end end |