aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,
+ },
}
}