diff options
author | Micah <micah@leap.se> | 2016-05-24 10:19:30 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-05-24 10:19:30 -0400 |
commit | 4cb98256c13db35223bbe16645a33bb62b81d9c8 (patch) | |
tree | 97e30c5d4542386a1a5b1aa3b4e8c65a7cab48ec /puppet/modules/x509/manifests/ca.pp | |
parent | 5f35e3a141cb52a5c7719074e932580f4b498db4 (diff) | |
parent | 09c79400ae368fa7f9b4e910451eef496c702d6c (diff) |
Merge commit '09c79400ae368fa7f9b4e910451eef496c702d6c' as 'puppet/modules/x509'
Diffstat (limited to 'puppet/modules/x509/manifests/ca.pp')
-rw-r--r-- | puppet/modules/x509/manifests/ca.pp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/puppet/modules/x509/manifests/ca.pp b/puppet/modules/x509/manifests/ca.pp new file mode 100644 index 00000000..0e068cd3 --- /dev/null +++ b/puppet/modules/x509/manifests/ca.pp @@ -0,0 +1,34 @@ +define x509::ca ( + $content = 'absent', + $source = 'absent' +) { + include x509::variables + include x509::base + + file { "${x509::variables::local_CAs}/${name}.crt" : + ensure => file, + mode => '0444', + group => 'ssl-cert', + require => 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"] { + content => $content + } + } + } +} |