summaryrefslogtreecommitdiff
path: root/manifests/ca.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/ca.pp')
-rw-r--r--manifests/ca.pp23
1 files changed, 21 insertions, 2 deletions
diff --git a/manifests/ca.pp b/manifests/ca.pp
index dc862d3..ceb9ce4 100644
--- a/manifests/ca.pp
+++ b/manifests/ca.pp
@@ -1,5 +1,6 @@
define x509::ca (
- $source = "puppet:///modules/site_x509/files/CAs/${name}.crt"
+ $content = 'absent',
+ $source = 'absent'
) {
include x509::variables
include x509::base
@@ -8,8 +9,26 @@ define x509::ca (
ensure => file,
mode => '0444',
group => 'ssl-cert',
- source => $source,
require => [ Package['openssl'], Package['ca-certificates'] ],
notify => Exec['update-ca-certificates'],
}
+ case $content {
+ 'absent': {
+ $real_source = $source ? {
+ 'absent' => [
+ "puppet:///modules/site_x509/CAs/${::fqdn}/${name}.crt",
+ "puppet:///modules/site_x509/CAs/${name}.crt"
+ ],
+ default => "puppet:///$source",
+ }
+ File["${x509::variables::local_CAs}/${name}.crt"] {
+ source => $real_source
+ }
+ }
+ default: {
+ File["${x509::variables::local_CAs}/${name}.crt"] {
+ source => $content
+ }
+ }
+ }
}