summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/manifests/x509cert_common.pp
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2021-05-08 07:30:12 +0200
committerJan Dittberner <jandd@cacert.org>2021-05-08 07:30:12 +0200
commit89f9a6ff3db08be55c5a00675ca5e4363cc84be9 (patch)
treee25a248b652bd5cb108fb37e3a1793938d895ed2 /sitemodules/profiles/manifests/x509cert_common.pp
parent8b2358cc9761889a0baa4d6c5a93e636f5fc1531 (diff)
downloadcacert-puppet-89f9a6ff3db08be55c5a00675ca5e4363cc84be9.tar.gz
cacert-puppet-89f9a6ff3db08be55c5a00675ca5e4363cc84be9.tar.xz
cacert-puppet-89f9a6ff3db08be55c5a00675ca5e4363cc84be9.zip
Fix unsupported variable reassignment
Use https://forge.puppet.com/modules/puppetlabs/stdlib/7.0.1/reference#pick-1 to workaround unsupported variable reassignment in the Puppet DSL.
Diffstat (limited to 'sitemodules/profiles/manifests/x509cert_common.pp')
-rw-r--r--sitemodules/profiles/manifests/x509cert_common.pp20
1 files changed, 3 insertions, 17 deletions
diff --git a/sitemodules/profiles/manifests/x509cert_common.pp b/sitemodules/profiles/manifests/x509cert_common.pp
index 8244130..2aafa8e 100644
--- a/sitemodules/profiles/manifests/x509cert_common.pp
+++ b/sitemodules/profiles/manifests/x509cert_common.pp
@@ -55,25 +55,11 @@ class profiles::x509cert_common (
}
$certificates.each |String $name, Data $cert_info| {
- $key_owner = 'root'
- $key_group = 'root'
- $key_mode = '0640'
-
- if 'key_owner' in $cert_info {
- $key_owner = $cert_info['key_owner']
- }
- if 'key_group' in $cert_info {
- $key_group = $cert_info['key_group']
- }
- if 'key_mode' in $cert_info {
- $key_mode = $cert_info['key_mode']
- }
-
file { "/etc/ssl/private/${name}.key.pem":
ensure => file,
- owner => $key_owner,
- group => $key_group,
- mode => $key_mode,
+ owner => pick($cert_info['key_owner'], 'root'),
+ group => pick($cert_info['key_group'], 'root'),
+ mode => pick($cert_info['key_mode'], 'root'),
content => $cert_info['private_key'],
}
file { "/etc/ssl/public/${name}.crt.pem":