diff options
author | Antoine Beaupre <anarcat@koumbit.org> | 2008-12-02 16:56:19 -0500 |
---|---|---|
committer | Antoine Beaupre <anarcat@koumbit.org> | 2008-12-02 16:56:19 -0500 |
commit | fa072188dc8f1b475d4000fe61ea4fcf5e82cf98 (patch) | |
tree | 49d1d561298a7c4c576503586819ec036a87f51a | |
parent | 6fb10939afd72a8e1243681f1ae9062abf0975fa (diff) | |
download | puppet-sshd-fa072188dc8f1b475d4000fe61ea4fcf5e82cf98.tar.gz puppet-sshd-fa072188dc8f1b475d4000fe61ea4fcf5e82cf98.tar.bz2 |
make saner defaults for authorized_keys
note that this removes the user => root default
-rw-r--r-- | manifests/init.pp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 1ac65f5..20dd1fb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -290,16 +290,29 @@ class sshd::openbsd inherits sshd::base { define sshd::ssh_authorized_key( $type = 'ssh-dss', $key, - $user = 'root', + $user = '', $target = undef, $options = 'absent' ) { + $real_user = $user ? { + false => $name, + "" => $name, + default => $user, + } + case $target { + undef: { + $real_target = "/home/$real_user/.ssh/authorized_keys" + } + default: { + $real_target = $target + } + } ssh_authorized_key{$name: type => $type, key => $key, - user => $user, - target => $target, + user => $real_user, + target => $real_target, } case $options { |