]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
try if setting a target fixes the problem
authormh <mh@immerda.ch>
Sat, 21 Feb 2009 16:36:36 +0000 (16:36 +0000)
committerMicah Anderson <micah@riseup.net>
Mon, 7 Dec 2009 21:03:46 +0000 (16:03 -0500)
manifests/init.pp

index d050050b5429d4975d26b946dbf96757ca992af1..4e5f824c189ce9687312c0c6e2509b5f06b8621a 100644 (file)
@@ -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,
-            }
-        }
-    }
 }