Skip to content

Commit 0f7113c

Browse files
authored
Merge pull request #426 from ComputeCanada/admin_alias
Add alias for sudoer account to display eyaml bootstrap values
2 parents 55723b5 + 073c31c commit 0f7113c

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

data/site.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ magic_castle::site::tags:
6060
- profile::reverse_proxy
6161
efa:
6262
- profile::efa
63+
puppet:
64+
- profile::puppetserver
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
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'
5+
$local_users = lookup('profile::users::local::users', undef, undef, {})
6+
$local_users.each | $user, $attrs | {
7+
if pick($attrs['sudoer'], false) {
8+
file_line { "${user}_eyamlbootstrap":
9+
path => "/${user}/.bashrc",
10+
line => "alias eyamlbootstrap=\"sudo ${eyaml_path} decrypt --pkcs7-private-key ${boot_private_key_path} -f ${boot_eyaml} | less\"",
11+
}
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)