Commit 6a005d68 authored by Tim Smith's avatar Tim Smith
Browse files

Fix openssl_rsa_public_key converging on every run


Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent 7bc118c7
......@@ -11,18 +11,15 @@ property :mode, [Integer, String], default: '0640'
action :create do
raise ArgumentError, "You cannot specify both 'private_key_path' and 'private_key_content' properties at the same time." if new_resource.private_key_path && new_resource.private_key_content
raise ArgumentError, "You must specify the private key with either 'private_key_path' or 'private_key_content' properties." unless new_resource.private_key_path || new_resource.private_key_content
raise "#{new_resource.private_key_path} not a valid private RSA key or password is invalid" unless priv_key_file_valid?((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass)
converge_by("Create an RSA public key #{new_resource.path} from #{new_resource.private_key_path}") do
raise "#{new_resource.private_key_path} not a valid private RSA key or password is invalid" unless priv_key_file_valid?((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass)
rsa_key_content = gen_rsa_pub_key((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass)
rsa_key_content = gen_rsa_pub_key((new_resource.private_key_path || new_resource.private_key_content), new_resource.private_key_pass)
file new_resource.path do
action :create
owner new_resource.owner
group new_resource.group
mode new_resource.mode
content rsa_key_content
end
file new_resource.path do
action :create
owner new_resource.owner
group new_resource.group
mode new_resource.mode
content rsa_key_content
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment