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/key.pp | |
parent | 5f35e3a141cb52a5c7719074e932580f4b498db4 (diff) | |
parent | 09c79400ae368fa7f9b4e910451eef496c702d6c (diff) |
Merge commit '09c79400ae368fa7f9b4e910451eef496c702d6c' as 'puppet/modules/x509'
Diffstat (limited to 'puppet/modules/x509/manifests/key.pp')
-rw-r--r-- | puppet/modules/x509/manifests/key.pp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/puppet/modules/x509/manifests/key.pp b/puppet/modules/x509/manifests/key.pp new file mode 100644 index 00000000..fd7e25fd --- /dev/null +++ b/puppet/modules/x509/manifests/key.pp @@ -0,0 +1,37 @@ +define x509::key ( + $content = 'absent', + $source = 'absent', + $owner = 'root', + $group = 'ssl-cert' +) { + include x509::variables + include x509::base + + file { "${x509::variables::keys}/${name}.key": + ensure => file, + mode => '0640', + owner => $owner, + group => $group, + require => Package['ssl-cert'] + } + + case $content { + 'absent': { + $real_source = $source ? { + 'absent' => [ + "puppet:///modules/site_x509/keys/${::fqdn}/${name}.key", + "puppet:///modules/site_x509/keys/${name}.key" + ], + default => "puppet:///$source", + } + File["${x509::variables::keys}/${name}.key"] { + source => $real_source + } + } + default: { + File["${x509::variables::keys}/${name}.key"] { + content => $content + } + } + } +} |