aboutsummaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-19 14:49:26 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-19 14:49:26 -0300
commit90e594d7fb30fded58b3248b5f10053ba4f8408d (patch)
treedadd8c51355174fa3278daa6310a87adc58cc56a /manifests
parent210ac88c5c9d45d3bd67cb9d8080031c8f095f52 (diff)
downloadpuppet-ssl-90e594d7fb30fded58b3248b5f10053ba4f8408d.tar.gz
puppet-ssl-90e594d7fb30fded58b3248b5f10053ba4f8408d.tar.bz2
Enhanced ensurable selectors
Diffstat (limited to 'manifests')
-rw-r--r--manifests/cert.pp25
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,
+ },
}
}