From e3cb846f323a7600607ae42238fcfc7cdca90a24 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 21 Feb 2009 16:36:36 +0000 Subject: try if setting a target fixes the problem --- manifests/init.pp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index d050050..4e5f824 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -290,10 +290,23 @@ define sshd::ssh_authorized_key( $target = 'absent', $options = 'absent' ){ + + case $target { + 'absent': { + case $user { + 'root': { $real_target = '/root/.ssh/authorized_keys' } + 'default': { $real_target = "/home/${user}/.ssh/authorized_keys" } + } + } + default: { + $real_target = $target + } + } ssh_authorized_key{$name: type => $type, key => $key, user => $user, + target => $real_target, } case $options { @@ -304,12 +317,4 @@ define sshd::ssh_authorized_key( } } } - case $target { - 'absent': { info("not setting any target for ssh_authorized_key: $name") } - default: { - Ssh_authorized_key[$name]{ - target => $target, - } - } - } } -- cgit v1.2.3