From b56d72cd3d8d25eaf473fe223e456e1e4bb50d46 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 19 Mar 2015 10:20:34 -0300 Subject: Add main parameter into ssl::cert --- manifests/cert.pp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/manifests/cert.pp b/manifests/cert.pp index e112817..fa77b8a 100644 --- a/manifests/cert.pp +++ b/manifests/cert.pp @@ -6,13 +6,14 @@ define ssl::cert( $privmode = '600', $base = '/etc/ssl', $private = true + $main = false, ) { - file { "${base}/certs/$name.crt": + file { "${base}/certs/${name}.crt": ensure => $ensure, owner => $owner, group => $group, mode => $pubmode, - source => "puppet:///ssl/$name.crt", + source => "puppet:///ssl/${name}.crt", require => File["${base}/certs"], } @@ -23,8 +24,18 @@ define ssl::cert( group => $group, mode => $privmode, backup => false, # Do not backup the private key - source => "puppet:///ssl/$name.pem", + source => "puppet:///ssl/${name}.pem", require => File["${base}/private"], } } + + if ($main == true) { + file { "${base}/certs/cert.crt": + ensure => "${base}/certs/${name}.crt", + } + + file { "${base}/private/cert.pem": + ensure => "${base}/private/${name}.pem", + } + } } -- cgit v1.2.3