]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
make saner defaults for authorized_keys
authorAntoine Beaupre <anarcat@koumbit.org>
Tue, 2 Dec 2008 21:56:19 +0000 (16:56 -0500)
committerAntoine Beaupre <anarcat@koumbit.org>
Tue, 2 Dec 2008 21:56:19 +0000 (16:56 -0500)
note that this removes the user => root default

manifests/init.pp

index 1ac65f58106653764c865e431a21d9384819e3fb..20dd1fbeee2575a97e0ccf9bbf0c370861181b75 100644 (file)
@@ -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 {