1 # create an ssh key for user
5 if $facts["${user}_user_exists"] == undef {
6 notify { "We do not have facters for user ${user} existance and keys -- add it to modules/debian_org/lib/facter/roleaccounts.rb":
9 } elsif $facts["${user}_user_exists"] {
10 if ! $facts["${user}_key"] {
11 exec { "create-${user}-ssh-key":
13 /bin/su - ${user} -c 'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q'
15 onlyif => "/usr/bin/getent passwd ${user} > /dev/null && ! [ -e ~${user}/.ssh/id_rsa ]"
19 notify { "User ${user} does not exist on this host. Will not create ssh key":