Skip to content

Commit 073c31c

Browse files
committed
Refactor puppetserver alias
1 parent 86d63eb commit 073c31c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

site/profile/manifests/puppetserver.pp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
class profile::puppetserver {
2+
$eyaml_path = '/opt/puppetlabs/puppet/bin/eyaml'
3+
$boot_private_key_path = '/etc/puppetlabs/puppet/eyaml/boot_private_key.pkcs7.pem'
4+
$boot_eyaml = '/etc/puppetlabs/code/environments/production/data/bootstrap.yaml'
25
$local_users = lookup('profile::users::local::users', undef, undef, {})
36
$local_users.each | $user, $attrs | {
47
if pick($attrs['sudoer'], false) {
58
file_line { "${user}_eyamlbootstrap":
69
path => "/${user}/.bashrc",
7-
line => 'alias eyamlbootstrap="sudo /opt/puppetlabs/puppet/bin/eyaml decrypt --pkcs7-private-key /etc/puppetlabs/puppet/eyaml/boot_private_key.pkcs7.pem -f /etc/puppetlabs/code/environments/production/data/bootstrap.yaml | less"'
10+
line => "alias eyamlbootstrap=\"sudo ${eyaml_path} decrypt --pkcs7-private-key ${boot_private_key_path} -f ${boot_eyaml} | less\"",
811
}
912
}
1013
}

0 commit comments

Comments
 (0)