]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
moved /dist/-stuff to /files/, heavily refactored a lot, made it more look all the...
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Fri, 4 Apr 2008 15:30:26 +0000 (15:30 +0000)
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Fri, 4 Apr 2008 15:30:26 +0000 (15:30 +0000)
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@1160 d66ca3ae-40d7-4aa7-90d4-87d79ca94279

manifests/init.pp
templates/sshd_config/Gentoo_normal.erb

index 14407d45b5ac29ecb90d233c64fd0af122c00e81..48363f18e51a84f6d16e86442c4c090f872afbc6 100644 (file)
@@ -5,51 +5,27 @@
 #modules_dir { "sshd": }
 
 class sshd {
+    case $operatingsystem {
+        gentoo: { include sshd::gentoo }
+        redhat: { include sshd::redhat }
+        centos: { include sshd::centos }
+        openbsd: { include sshd::openbsd }
+        default: { include sshd::default }
+    }
+}
+
 
-       case $operatingsystem {
-               OpenBSD: {
-                       exec{sshd_refresh:
-                   command => "/bin/kill -HUP `/bin/cat /var/run/sshd.pid`",
-                   refreshonly => true,
-            }
-               }
-               default: {
-                       service{'sshd':
-                name => $operatingsystem ? {
-                    debian => 'ssh',
-                    ubuntu => 'ssh',
-                    default => 'sshd',
-                },
-                enable => true,
-                ensure => running,
-                               require => Package[openssh],
-            }
             
-                       package{openssh:
-                name => $operatingsystem ? {
-                    debian => 'openssh-server',
-                    ubuntu => 'openssh-server',
-                    redhat => 'openssh-server',
-                    centos => 'openssh-server',
-                    default => 'openssh',
-                },
-                category => $operatingsystem ? {
-                       gentoo => 'net-misc',
-                               default => '',
-                   },
-                       ensure => present,
-                       }
 
                }
        }
 
+class sshd::base {
        $real_sshd_config_source = $sshd_config_source ? {
            '' => "sshd/sshd_config/${operatingsystem}_normal.erb",
        default => $source,
        }
 
-    #notice("sshd_allowed_users is set to ${sshd_allowed_users}")
-
     $real_sshd_allowed_users = $sshd_allowed_users ? {
         ''  => 'root',
        default => $sshd_allowed_users,
@@ -61,13 +37,74 @@ class sshd {
         group => 0,
         mode => 600,
         content => template("${real_sshd_config_source}"),
-       notify => $operatingsystem ? { 
-               openbsd => Exec[sshd_refresh],
-                   default => Service[sshd],
-       },
     }
 }
 
+class sshd::linux inherits sshd::base {
+    package{openssh:
+           ensure => present,
+       }
+    include sshd::service
+    File[sshd_config]{
+        notify => Service[sshd],
+    }
+}
+
+class sshd::gentoo inherits sshd::linux {
+    Package[openssh]{
+        category => 'net-misc',
+    }
+}
+
+class sshd::debian inherits sshd::linux {
+    Package[openssh]{
+        name => 'openssh-server',
+    }
+}
+class sshd::ubuntu inherits sshd::debian {}
+
+class sshd::redhat inherits sshd::linux {
+    Package[openssh]{
+        name => 'openssh-server',
+    }
+}
+class sshd::centos inherits sshd::redhat {}
+
+class sshd::openbsd inherits sshd::base {
+    exec{sshd_refresh:
+        command => "/bin/kill -HUP `/bin/cat /var/run/sshd.pid`",
+           refreshonly => true,
+    }
+    File[sshd_config]{
+        notify => Exec[sshd_refresh],
+    }
+}
+
+### service stuff 
+class sshd::service {
+    case $operatingsystem {
+        debian: { include sshd::service::debian }
+        ubuntu: { include sshd::service::ubuntu }
+        default: { include sshd::service::base }
+    }
+
+class sshd::service::base {
+    service{'sshd':
+        name => 'sshd',
+        enable => true,
+        ensure => running,
+               require => Package[openssh],
+     }
+}
+
+class sshd::service::debian inherits sshd::service::base {
+    Service[sshd]{
+        name => 'ssh',
+    }
+}
+class sshd::service::ubuntu inherits sshd::service::debian {}
+
+### defines 
 define sshd::deploy_auth_key(
         $source = '', 
         $user = 'root', 
@@ -85,8 +122,8 @@ define sshd::deploy_auth_key(
         }
 
         $real_source = $source ? {
-            '' => [ "puppet://$server/sshd/authorized_keys/${name}",
-                    "puppet://$server/dist/sshd/authorized_keys/${name}"],
+            '' => [ "puppet://$server/files/sshd/authorized_keys/${name}",
+                    "puppet://$server/sshd/authorized_keys/${name}" ]
             default => "puppet://$server/$source",
         }
 
index aacd07a211699ecc331848fadaa03da27697050b..be78eb9405ddf7eef051970f26b5acac4eecbbe8 100644 (file)
@@ -72,6 +72,8 @@ PasswordAuthentication no
 # GSSAPI options
 #GSSAPIAuthentication no
 #GSSAPICleanupCredentials yes
+#GSSAPIStrictAcceptorCheck yes
+#GSSAPIKeyExchange no
 
 # Set this to 'yes' to enable PAM authentication, account processing, 
 # and session processing. If this is enabled, PAM authentication will