Skip to content

Commit 86d63eb

Browse files
committed
Add alias for sudoer account to display eyaml bootstrap values
1 parent 234c9f7 commit 86d63eb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class profile::puppetserver {
2+
$local_users = lookup('profile::users::local::users', undef, undef, {})
3+
$local_users.each | $user, $attrs | {
4+
if pick($attrs['sudoer'], false) {
5+
file_line { "${user}_eyamlbootstrap":
6+
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"'
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)