]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
Merge commit 'puzzle/development'
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Tue, 29 Jul 2008 23:30:05 +0000 (23:30 +0000)
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Tue, 29 Jul 2008 23:30:05 +0000 (23:30 +0000)
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@2092 d66ca3ae-40d7-4aa7-90d4-87d79ca94279

manifests/init.pp

index 569b234dcb97d12f973242985e800cbe3026bd2f..7b14e8b41dc0a3cdf4f7175732bcc61fc9302c7d 100644 (file)
@@ -90,6 +90,18 @@ class sshd::base {
         content => template("sshd/sshd_config/${operatingsystem}_normal.erb"),
         notify => Service[sshd],
     }
+    # Now add the key, if we've got one
+    case $sshrsakey_key {
+        '': { info("no sshrsakey on $fqdn") }
+        default: {
+            @@sshkey{"$hostname.$domain":
+                type => ssh-rsa,
+                key => $sshrsakey_key,
+                ensure => present,
+                require => Package["openssh-clients"],
+            }
+        }
+    }
     service{'sshd':
         name => 'sshd',
         enable => true,
@@ -154,12 +166,40 @@ class sshd::openbsd inherits sshd::base {
 }
 
 ### defines 
+# wrapper to have some defaults.
+define sshd::ssh_authorized_key(
+    $type = 'ssh-dss',
+    $key,
+    $user = 'root',
+    $target = undef,
+    $options = 'absent'
+){
+    ssh_authorized_key{$name:
+        type => $type,
+        key => $key,
+        user => $root,
+        target => $target,
+    }
+
+    case $options {
+        'absent': { info("not setting any option for ssh_authorized_key: $name") }
+        default: {
+            Ssh_authorized_key[$name]{
+                options => $options,
+            }
+        }
+    }
+}
+
+# deprecated!
 define sshd::deploy_auth_key(
         $source = 'present',
         $user = 'root', 
         $target_dir = '/root/.ssh/', 
         $group = 0 ) {
 
+        notice("this way of deploying authorized keys is deprecated. use the native ssh_authorized_key instead")
+
         $real_target = $target_dir ? {
                 '' => "/home/$user/.ssh/",
                 default => $target_dir,