summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordheerajd-msys <dheeraj.dubey@msystechnologies.com>2019-01-17 16:15:46 +0530
committerBryan McLellan <btm@loftninjas.org>2019-02-21 15:43:47 -0500
commitbb83453de05154b357594c339b56fd37a14b7489 (patch)
treeec1171ef08ffceeda87da42099825a0a733f0265
parent3a6513b332ea3cd6e5cf5315e7d1c6c2e17cb900 (diff)
downloadchef-bb83453de05154b357594c339b56fd37a14b7489.tar.gz
update property for existing file
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
-rw-r--r--lib/chef/resource/openssl_dhparam.rb18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/chef/resource/openssl_dhparam.rb b/lib/chef/resource/openssl_dhparam.rb
index ef4fa3d861..b93ad81f55 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