diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-19 14:49:26 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-19 14:49:26 -0300 |
commit | 90e594d7fb30fded58b3248b5f10053ba4f8408d (patch) | |
tree | dadd8c51355174fa3278daa6310a87adc58cc56a /manifests/cert.pp | |
parent | 210ac88c5c9d45d3bd67cb9d8080031c8f095f52 (diff) | |
download | puppet-ssl-90e594d7fb30fded58b3248b5f10053ba4f8408d.tar.gz puppet-ssl-90e594d7fb30fded58b3248b5f10053ba4f8408d.tar.bz2 |
Enhanced ensurable selectors
Diffstat (limited to 'manifests/cert.pp')
-rw-r--r-- | manifests/cert.pp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/manifests/cert.pp b/manifests/cert.pp index f9d916d..3d6498f 100644 --- a/manifests/cert.pp +++ b/manifests/cert.pp @@ -14,7 +14,10 @@ define ssl::cert( owner => $owner, group => $group, mode => $pubmode, - source => "puppet:///ssl/${name}.crt", + source => $ensure ? { + 'present' => "puppet:///ssl/${name}.crt", + default => undef, + }, require => File["${base}/certs"], } @@ -25,7 +28,10 @@ define ssl::cert( group => $group, mode => $privmode, backup => false, # Do not backup the private key - source => "puppet:///ssl/${name}.pem", + source => $ensure ? { + 'present' => "puppet:///ssl/${name}.pem", + default => undef, + }, require => File["${base}/private"], } } @@ -40,10 +46,15 @@ define ssl::cert( } } - if ($verify == true) { - ssl::check { "${name}": - file => true, - base => $base, - } + ssl::check { "${name}": + file => true, + base => $base, + ensure => $ensure ? { + present => $verify ? { + true => present, + default => absent, + }, + default => absent, + }, } } |