From 272a281618654934882657cc03b42fb6725d00d2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 13 Mar 2014 17:49:32 -0300 Subject: Add private parameter to ssl::cert --- manifests/init.pp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 2cb36e7..f56b8f1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,8 @@ class ssl { } define cert($ensure = present, $owner = 'root', $group = 'root', - $pubmode = '644', $privmode = '600', $base = '/etc/ssl') { + $pubmode = '644', $privmode = '600', $base = '/etc/ssl', + $private = true) { file { "${base}/certs/$name.crt": ensure => $ensure, owner => $owner, @@ -24,14 +25,16 @@ class ssl { require => File["${base}/certs"], } - file { "${base}/private/$name.pem": - ensure => $ensure, - owner => $owner, - group => $group, - mode => $privmode, - backup => false, # Do not backup the private key - source => "puppet:///modules/site_keys/ssl/$name.pem", - require => File["${base}/private"], + if ($private == true) { + file { "${base}/private/$name.pem": + ensure => $ensure, + owner => $owner, + group => $group, + mode => $privmode, + backup => false, # Do not backup the private key + source => "puppet:///modules/site_keys/ssl/$name.pem", + require => File["${base}/private"], + } } } -- cgit v1.2.3