summaryrefslogtreecommitdiff
path: root/puppet/modules/x509/manifests/ca.pp
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-06-09 17:35:16 +0200
committervarac <varacanero@zeromail.org>2016-06-14 12:05:18 +0200
commitd23f3dba54e8ec7d8ceeee03a011529f699cc31a (patch)
tree6a34d976979ca7a0eced2564eeb4cf031f5a17c8 /puppet/modules/x509/manifests/ca.pp
parentbfb413191999127e01699873ba061f91935fb9c3 (diff)
git subrepo clone https://leap.se/git/puppet_x509 puppet/modules/x509
subrepo: subdir: "puppet/modules/x509" merged: "19254a3" upstream: origin: "https://leap.se/git/puppet_x509" branch: "master" commit: "19254a3" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "cb2995b"
Diffstat (limited to 'puppet/modules/x509/manifests/ca.pp')
-rw-r--r--puppet/modules/x509/manifests/ca.pp34
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
+ }
+ }
+ }
+}