]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
new style for 2.7
authormh <mh@immerda.ch>
Tue, 5 Jun 2012 21:23:03 +0000 (18:23 -0300)
committermh <mh@immerda.ch>
Tue, 5 Jun 2012 21:23:03 +0000 (18:23 -0300)
23 files changed:
README
manifests/base.pp
manifests/client.pp
manifests/client/base.pp
manifests/client/linux.pp
manifests/debian.pp
manifests/init.pp
manifests/libssh2.pp
manifests/libssh2/devel.pp
manifests/linux.pp
manifests/nagios.pp
templates/sshd_config/CentOS.erb
templates/sshd_config/CentOS_Final.erb [changed from symlink to file mode: 0644]
templates/sshd_config/Debian_etch.erb
templates/sshd_config/Debian_lenny.erb
templates/sshd_config/Debian_sid.erb
templates/sshd_config/Debian_squeeze.erb
templates/sshd_config/Debian_wheezy.erb [changed from symlink to file mode: 0644]
templates/sshd_config/FreeBSD.erb
templates/sshd_config/Gentoo.erb
templates/sshd_config/OpenBSD.erb
templates/sshd_config/Ubuntu.erb [changed from symlink to file mode: 0644]
templates/sshd_config/Ubuntu_lucid.erb

diff --git a/README b/README
index 5d143926de86cc68d47df13157010d061e7d7a3b..417e289705548b2d20f912660be6290ba92f98e1 100644 (file)
--- a/README
+++ b/README
@@ -24,11 +24,12 @@ Nagios
 ------
 
 To have nagios checks setup automatically for sshd services, simply set
-$use_nagios = true before the class is included. If you want to disable ssh
+use_nagios to true in hiera. If you want to disable ssh
 nagios checking for a particular node (such as when ssh is firewalled), then you
-can set $nagios_check_ssh to false and that node will not be monitored.  
+can set the class parameter nagios_check_ssh to false and that node will not bei
+monitored.  
 
-Nagios will automatically check the ports defined in $sshd_ports, and the
+Nagios will automatically check the ports defined in $sshd::ports, and the
 hostname specified by $nagios_check_ssh_hostname.
 
 NOTE: this requires that you are using the shared-nagios puppet module which
index 848e547e26e98d8e01511574410a6b90acf5e7dc..4001985a7acd3bacf563b85805debcedc885eb0d 100644 (file)
@@ -1,31 +1,31 @@
-class sshd::base {     
+class sshd::base {
   file { 'sshd_config':
     path => '/etc/ssh/sshd_config',
-    content => $lsbdistcodename ? {
-      '' => template("sshd/sshd_config/${operatingsystem}.erb"),
-      default => template ("sshd/sshd_config/${operatingsystem}_${lsbdistcodename}.erb"),
+    content => $::lsbdistcodename ? {
+      '' => template("sshd/sshd_config/${::operatingsystem}.erb"),
+      default => template ("sshd/sshd_config/${::operatingsystem}_${::lsbdistcodename}.erb"),
     },
     notify => Service[sshd],
     owner => root, group => 0, mode => 600;
   }
 
   # Now add the key, if we've got one
-  case $sshrsakey {
-    '': { info("no sshrsakey on $fqdn") }
+  case $::sshrsakey {
+    '': { info("no sshrsakey on ${::fqdn}") }
     default: {
-      @@sshkey{"$fqdn":
+      @@sshkey{$::fqdn:
         tag    => "fqdn",
         type   => ssh-rsa,
-        key    => $sshrsakey,
+        key    => $::sshrsakey,
         ensure => present,
       }
       # In case the node has uses a shared network address,
       # we don't define a sshkey resource using an IP address
-      if $sshd_shared_ip == "no" {
-        @@sshkey{"$ipaddress":
+      if $sshd::shared_ip == "no" {
+        @@sshkey{$::ipaddress:
           tag    => "ipaddress",
           type   => ssh-rsa,
-          key    => $sshrsakey,
+          key    => $::sshrsakey,
           ensure => present,
         }
       }
index 5eed5fcbc9336701d972c794888b96312f3887c4..c99cf27010e12956835145b40618cff8a574d487 100644 (file)
@@ -1,23 +1,21 @@
 # manifests/client.pp
 
-class sshd::client {
+class sshd::client(
+  $shared_ip = hiera('sshd_shared_ip','no'),
+  $ensure_version = hiera('sshd_ensure_version','installed')
+) {
 
-  case $sshd_shared_ip {
-    '': { $sshd_shared_ip = "no" }
-  }
-
-  case $operatingsystem {
+  case $::operatingsystem {
     debian,ubuntu: { include sshd::client::debian }
     default: {
-      case $kernel {
+      case $::kernel {
         linux: { include sshd::client::linux }
         default: { include sshd::client::base }
       }
     }
   }
 
-  if $use_shorewall{
+  if hiera('use_shorewall',false) {
     include shorewall::rules::out::ssh
   }
-
 }
index 1fe2b14ca3a32cfe55633a633a2b7cd1e9b1ac5c..c2580c1f6a30f5a9ff37402af3383a766fbdd991 100644 (file)
@@ -1,10 +1,11 @@
 class sshd::client::base {
   # this is needed because the gid might have changed
-  config_file { '/etc/ssh/ssh_known_hosts':
+  file { '/etc/ssh/ssh_known_hosts':
+    mode => 0644, owner => root, group => 0;
   }
 
   # Now collect all server keys
-  case $sshd_shared_ip {
+  case $sshd::client::shared_ip {
     no:  { Sshkey <<||>> }
     yes: { Sshkey <<| tag == "fqdn" |>> }
   }
index 8c58ca85ff20fd22f033ede456fa28d9bc84d2ac..0c420be25140bb0a998a8804f9bd87c985e351e3 100644 (file)
@@ -1,6 +1,5 @@
 class sshd::client::linux inherits sshd::client::base {
-  if $ssh_ensure_version == '' { $ssh_ensure_version = 'installed' }
   package {'openssh-clients':
-    ensure => $ssh_ensure_version,
+    ensure => $sshd::client::ensure_version,
   }
 }
index 43dc26c7d9a8977f3317829e828e46531141929f..45eb9018957c903ad45a0bf7dc4caa165bcb3f95 100644 (file)
@@ -7,7 +7,7 @@ class sshd::debian inherits sshd::linux {
     name => 'openssh-server',
   }
 
-  $sshd_restartandstatus = $lsbdistcodename ? {
+  $sshd_restartandstatus = $::lsbdistcodename ? {
     etch => false,
     default => true
   }
index 8b3361c2fc55b001b2e9223658b7f07945301305..f183acd3a0cd445472784501257ef43ef256b496 100644 (file)
-class sshd {
-   # prepare variables to use in templates
-  case $sshd_listen_address {
-    '': { $sshd_listen_address = [ '0.0.0.0', '::' ] }
-  }
-  case $sshd_allowed_users {
-    '': { $sshd_allowed_users = '' }
-  }
-  case $sshd_allowed_groups {
-    '': { $sshd_allowed_groups = '' }
-  }
-  case $sshd_use_pam {
-    '': { $sshd_use_pam = 'no' }
-  }
-  case $sshd_permit_root_login {
-    '': { $sshd_permit_root_login = 'without-password' }
-  }
-  case $sshd_password_authentication {
-    '': { $sshd_password_authentication = 'no' }
-  }
-  case $sshd_kerberos_authentication {
-    '': { $sshd_kerberos_authentication = 'no' }
-  }
-  case $sshd_kerberos_orlocalpasswd {
-    '': { $sshd_kerberos_orlocalpasswd = 'yes' }
-  }
-  case $sshd_kerberos_ticketcleanup {
-    '': { $sshd_kerberos_ticketcleanup = 'yes' }
-  }
-  case $sshd_gssapi_authentication {
-    '': { $sshd_gssapi_authentication = 'no' }
-  }
-  case $sshd_gssapi_cleanupcredentials {
-    '': { $sshd_gssapi_cleanupcredentials = 'yes' }
-  }
-  case $sshd_tcp_forwarding {
-    '': { $sshd_tcp_forwarding = 'no' }
-  }
-  case $sshd_x11_forwarding {
-    '': { $sshd_x11_forwarding = 'no' }
-  }
-  case $sshd_agent_forwarding {
-    '': { $sshd_agent_forwarding = 'no' }
-  }
-  case $sshd_challenge_response_authentication {
-    '': { $sshd_challenge_response_authentication = 'no' }
-  }
-  case $sshd_pubkey_authentication {
-    '': { $sshd_pubkey_authentication = 'yes' }
-  }
-  case $sshd_rsa_authentication {
-    '': { $sshd_rsa_authentication = 'no' }
-  }
-  case $sshd_strict_modes {
-    '': { $sshd_strict_modes = 'yes' }
-  }
-  case $sshd_ignore_rhosts {
-    '': { $sshd_ignore_rhosts = 'yes' }
-  }
-  case $sshd_rhosts_rsa_authentication {
-    '': { $sshd_rhosts_rsa_authentication = 'no' }
-  }
-  case $sshd_hostbased_authentication {
-    '': { $sshd_hostbased_authentication = 'no' }
-  }
-  case $sshd_permit_empty_passwords {
-    '': { $sshd_permit_empty_passwords = 'no' }
-  }
-  if ( $sshd_port != '' ) and ( $sshd_ports != []) {
-      err("Cannot use sshd_port and sshd_ports at the same time.")
-  }
-  if $sshd_port != '' {
-      $sshd_ports = [ $sshd_port ]
-  } elsif ! $sshd_ports {
-      $sshd_ports = [ 22 ]
-  }
-  case $sshd_authorized_keys_file {
-    '': { $sshd_authorized_keys_file = "%h/.ssh/authorized_keys" }
-  }
-  case $sshd_hardened_ssl {
-    '': { $sshd_hardened_ssl = 'no' }
-  }
-  case $sshd_sftp_subsystem {
-    '': { $sshd_sftp_subsystem = '' }
-  }
-  case $sshd_head_additional_options {
-    '': { $sshd_head_additional_options = '' }
-  }
-  case $sshd_tail_additional_options {
-    '': { $sshd_tail_additional_options = '' }
-  }
-  case $sshd_ensure_version {
-    '': { $sshd_ensure_version = "present" }
-  }
-  case $sshd_print_motd {
-    '': {
-      case $operatingsystem {
-        debian,ubuntu: { $sshd_print_motd = "no" }
-        default: { $sshd_print_motd = "yes" }
-      }
-    }
-  }
-  case $sshd_shared_ip {
-    '': { $sshd_shared_ip = "no" }
-  }
+class sshd(
+  $nagios_check_ssh = hiera('nagios_check_ssh',true),
+  $nagios_check_ssh_hostname = hiera('nagios_check_ssh_hostname','absent'),
+  $ports = hiera('sshd_ports',[ 22 ]),
+  $shared_ip = hiera('sshd_shared_ip','no'),
+  $ensure_version = hiera('sshd_ensure_version','installed'),
+  $listen_address = hiera('sshd_listen_address',[ '0.0.0.0', '::' ]),
+  $allowed_users = hiera('sshd_allowed_users',''),
+  $allowed_groups = hiera('sshd_allowed_groups',''),
+  $use_pam = hiera('sshd_use_pam','no'),
+  $permit_root_login = hiera('sshd_permit_root_login','without-password'),
+  $password_authentication = hiera('sshd_password_authentication','no'),
+  $kerberos_authentication = hiera('sshd_kerberos_authentication','no'),
+  $kerberos_orlocalpasswd = hiera('sshd_sshd_kerberos_orlocalpasswd','yes'),
+  $kerberos_ticketcleanup = hiera('sshd_kerberos_ticketcleanup','yes'),
+  $gssapi_authentication = hiera('sshd_gssapi_authentication','no'),
+  $gssapi_cleanupcredentials = hiera('sshd_gssapi_cleanupcredentials','yes'),
+  $tcp_forwarding = hiera('sshd_tcp_forwarding','no'),
+  $x11_forwarding = hiera('sshd_x11_forwarding','no'),
+  $agent_forwarding = hiera('sshd_agent_forwarding','no'),
+  $challenge_response_authentication = hiera('sshd_challenge_response_authentication','no'),
+  $pubkey_authentication = hiera('sshd_pubkey_authentication','yes'),
+  $rsa_authentication = hiera('rsa_authentication','no'),
+  $strict_modes = hiera('sshd_strict_modes','yes'),
+  $ignore_rhosts = hiera('sshd_ignore_rhosts','yes'),
+  $rhosts_rsa_authentication = hiera('sshd_rhosts_rsa_authentication','no'),
+  $hostbased_authentication = hiera('sshd_hostbased_authentication','no'),
+  $permit_empty_passwords = hiera('sshd_permit_empty_passwords','no'),
+  $authorized_keys_file = hiera('sshd_authorized_keys_file','%h/.ssh/authorized_keys'),
+  $hardened_ssl = hiera('sshd_hardened_ssl','no'),
+  $sftp_subsystem = hiera('sshd_sftp_subsystem',''),
+  $head_additional_options = hiera('sshd_head_additional_options',''),
+  $tail_additional_options = hiera('sshd_tail_additional_options',''),
+  $print_motd = hiera('sshd_print_motd','yes')
+) {
 
-  include sshd::client
+  class{'sshd::client':
+    shared_ip => $sshd::shared_ip,
+    ensure_version => $sshd::ensure_version
+  }
 
-  case $operatingsystem {
+  case $::operatingsystem {
     gentoo: { include sshd::gentoo }
     redhat,centos: { include sshd::redhat }
-    centos: { include sshd::centos }
     openbsd: { include sshd::openbsd }
     debian,ubuntu: { include sshd::debian }
     default: { include sshd::base }
   }
 
-  if $use_nagios {
-    case $nagios_check_ssh {
-      false: { info("We don't do nagioschecks for ssh on ${fqdn}" ) }
-      default: {
-        sshd::nagios{$sshd_ports:
-          check_hostname => $nagios_check_ssh_hostname ? {
-            '' => 'absent',
-            undef => 'absent',
-            default => $nagios_check_ssh_hostname
-          }
-        }
-      }
+  if hiera('use_nagios',false) and $sshd::nagios_check_ssh {
+    sshd::nagios{$sshd::ports:
+      check_hostname => $sshd::nagios_check_ssh_hostname
     }
   }
 
-  if $use_shorewall{
+  if hiera('use_shorewall', false) {
     class{'shorewall::rules::ssh':
-      ports => $sshd_ports,
+      ports => $sshd::ports,
     }
   }
 }
index 5b4e363cd9116d8be3db0eb1e4b9b6b72752a083..403ac7be9aa83075175408ccebc46d0085245659 100644 (file)
@@ -1,7 +1,7 @@
 # manifests/libssh2.pp
 
 class sshd::libssh2 {
-    package{'libssh2':
-        ensure => present,
-    }
+  package{'libssh2':
+    ensure => present,
+  }
 }
index 87a8697cd6bac326a085a1756b0790dce47d7e8e..261e34c8fede1a0cbf6b7bb576d58b452814210f 100644 (file)
@@ -1,7 +1,7 @@
 # manifests/libssh2/devel.pp
 
 class sshd::libssh2::devel inherits sshd::libssh2 {
-    package{"libssh2-devel.${architecture}":
-        ensure => installed,
-    }
+  package{"libssh2-devel.${::architecture}":
+    ensure => installed,
+  }
 }
index a1f4e2a449d3bb57b798cbb00008c40cff9b869d..f071adac390895a48be1b53533d5092b87ab381c 100644 (file)
@@ -1,6 +1,6 @@
 class sshd::linux inherits sshd::base {
   package{openssh:
-    ensure => $sshd_ensure_version,
+    ensure => $sshd::ensure_version,
   }
   File[sshd_config]{
     require +> Package[openssh],
index 7742cdb35e7c9c54ee4f55271c45ed35df04f36b..ef5fe104ed4139a326a2ef6f02c958da2cfd9bfc 100644 (file)
@@ -11,7 +11,7 @@ define sshd::nagios(
     'absent': {
       nagios::service{"ssh_port_${name}":
         ensure => $ensure,
-        check_command => "check_ssh_port!$real_port"
+        check_command => "check_ssh_port!${real_port}"
       }
     }
     default: {
index 3d5b5b09ec26795e2f6ce5a3bd8f284a7c222f2e..0f4bb1f8df5c6f2c0675a3c5aa56b98aab6b6bb2 100644 (file)
 # possible, but leave them commented.  Uncommented options change a
 # default value.
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # only protocol 2
 Protocol 2
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 
@@ -48,83 +48,39 @@ SyslogFacility AUTHPRIV
 # Authentication:
 
 #LoginGraceTime 2m
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login %>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
 #MaxAuthTries 6
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Change to yes if you don't trust ~/.ssh/known_hosts for
 # RhostsRSAAuthentication and HostbasedAuthentication
 #IgnoreUserKnownHosts no
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # Kerberos options
 #KerberosAuthentication no
@@ -145,33 +101,21 @@ ChallengeResponseAuthentication no
 # session checks to run without PAM authentication, then enable this but set 
 # ChallengeResponseAuthentication=no
 #UsePAM no
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
 # Accept locale-related environment variables
 AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
 AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
 AcceptEnv LC_IDENTIFICATION LC_ALL
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
 #GatewayPorts no
 #X11Forwarding no
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 #X11DisplayOffset 10
 #X11UseLocalhost yes
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 #PrintLastLog yes
 #TCPKeepAlive yes
 #UseLogin no
@@ -191,24 +135,20 @@ PrintMotd <%= sshd_print_motd %>
 #Banner /some/path
 
 # override default of no subsystems
-<%- if sshd_sftp_subsystem.to_s.empty? then -%>
-Subsystem      sftp    /usr/libexec/openssh/sftp-server
-<%- else -%>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end -%>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %> 
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users %>
-<%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then -%>
-AllowGroups <%= sshd_allowed_groups %>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
deleted file mode 120000 (symlink)
index 03246aabcf562b1f454bee0c8511edb2132cff1a..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-CentOS.erb
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..0f4bb1f8df5c6f2c0675a3c5aa56b98aab6b6bb2
--- /dev/null
@@ -0,0 +1,154 @@
+#      $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options change a
+# default value.
+
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
+
+# only protocol 2
+Protocol 2
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
+#Port -- disabled by puppet
+<% else -%>
+Port <%= port %>
+<% end -%>
+<% end -%>
+
+# Use these options to restrict which interfaces/protocols sshd will bind to
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+ListenAddress <%= address %>
+<% end -%>
+
+# HostKey for protocol version 1
+#HostKey /etc/ssh/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 768
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+SyslogFacility AUTHPRIV
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+
+#MaxAuthTries 6
+
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+
+# similar for protocol version 2
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+
+# Don't read the user's ~/.rhosts and ~/.shosts files
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+
+# To enable empty passwords, change to yes (NOT RECOMMENDED)
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+
+# Change to no to disable s/key passwords
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing, 
+# and session processing. If this is enabled, PAM authentication will 
+# be allowed through the ChallengeResponseAuthentication mechanism. 
+# Depending on your PAM configuration, this may bypass the setting of 
+# PasswordAuthentication, PermitEmptyPasswords, and 
+# "PermitRootLogin without-password". If you just want the PAM account and 
+# session checks to run without PAM authentication, then enable this but set 
+# ChallengeResponseAuthentication=no
+#UsePAM no
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+
+# Accept locale-related environment variables
+AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 
+AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 
+AcceptEnv LC_IDENTIFICATION LC_ALL
+
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+
+#GatewayPorts no
+#X11Forwarding no
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+#UsePrivilegeSeparation yes
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#ShowPatchLevel no
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+#ChrootDirectory none
+
+# no default banner path
+#Banner /some/path
+
+# override default of no subsystems
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/openssh/sftp-server' : s %> 
+
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
+<%- end -%>
+
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+Ciphers aes256-ctr
+MACs hmac-sha1
+<% end -%>
+
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index 104722209cc07c973d9e41799580617f24b73675..ef4a5d106dd62a89eeceace0c9e62badb3385bbf 100644 (file)
@@ -1,21 +1,21 @@
 # Package generated configuration file
 # See the sshd(8) manpage for details
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 Protocol 2
@@ -39,80 +39,36 @@ LogLevel INFO
 
 # Authentication:
 LoginGraceTime 600
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
 #IgnoreUserKnownHosts yes
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To change Kerberos options
 #KerberosAuthentication no
@@ -123,11 +79,7 @@ PasswordAuthentication no
 # Kerberos TGT Passing does only work with the AFS kaserver
 #KerberosTgtPassing yes
 
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 X11DisplayOffset 10
 KeepAlive yes
 #UseLogin no
@@ -136,11 +88,7 @@ KeepAlive yes
 #Banner /etc/issue.net
 #ReverseMappingCheck yes
 
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
 
 # Set this to 'yes' to enable PAM authentication, account processing, 
 # and session processing. If this is enabled, PAM authentication will 
@@ -151,32 +99,24 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
 
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index 4ffb94c2c05b8377f12861a886cc41c8a3ca98e8..8cbea306b12d988a3183b0208b23fb79af4cdf1d 100644 (file)
@@ -1,21 +1,21 @@
 # Package generated configuration file
 # See the sshd(8) manpage for details
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 Protocol 2
@@ -39,80 +39,36 @@ LogLevel INFO
 
 # Authentication:
 LoginGraceTime 600
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
 #IgnoreUserKnownHosts yes
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To change Kerberos options
 #KerberosAuthentication no
@@ -123,11 +79,7 @@ PasswordAuthentication no
 # Kerberos TGT Passing does only work with the AFS kaserver
 #KerberosTgtPassing yes
 
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 X11DisplayOffset 10
 KeepAlive yes
 #UseLogin no
@@ -139,11 +91,7 @@ KeepAlive yes
 # Allow client to pass locale environment variables
 AcceptEnv LANG LC_*
 
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
 
 # Set this to 'yes' to enable PAM authentication, account processing, 
 # and session processing. If this is enabled, PAM authentication will 
@@ -154,38 +102,26 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
-<%- if sshd_agent_forwarding.to_s == 'yes' then -%>
-AllowAgentForwarding yes
-<%- else -%>
-AllowAgentForwarding no
-<%- end -%>
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
 
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index b211708b46e57b200553296c1dbe3688ef153554..9fc34d44e5b813d36496a050e88b6a02fdd1ffad 100644 (file)
@@ -3,21 +3,21 @@
 # Package generated configuration file
 # See the sshd(8) manpage for details
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 Protocol 2
@@ -37,115 +37,47 @@ LogLevel INFO
 
 # Authentication:
 LoginGraceTime 600
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 # For this to work you will also need host keys in /etc/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
 #IgnoreUserKnownHosts yes
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to yes to enable challenge-response passwords (beware issues with
 # some PAM modules and threads)
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # Kerberos options
-<%- if sshd_kerberos_authentication.to_s == 'yes' then -%>
-KerberosAuthentication yes
-<%- else -%>
-KerberosAuthentication no
-<%- end -%>
-<%- if sshd_kerberos_orlocalpasswd.to_s == 'yes' then -%>
-KerberosOrLocalPasswd yes
-<%- else -%>
-KerberosOrLocalPasswd no
-<%- end -%>
-<%- if sshd_kerberos_ticketcleanup.to_s == 'yes' then -%>
-KerberosTicketCleanup yes
-<%- else -%>
-KerberosTicketCleanup no
-<%- end -%>
+KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_aorlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
 
 # GSSAPI options
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPIAuthentication yes
-<%- else -%>
-GSSAPIAuthentication no
-<%- end -%>
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPICleanupCredentials yes
-<%- else -%>
-GSSAPICleanupCredentials yes
-<%- end -%>
+GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
 
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 X11DisplayOffset 10
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 PrintLastLog yes
 TCPKeepAlive yes
 
@@ -157,11 +89,7 @@ TCPKeepAlive yes
 # Allow client to pass locale environment variables
 AcceptEnv LANG LC_*
 
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
 
 # Set this to 'yes' to enable PAM authentication, account processing,
 # and session processing. If this is enabled, PAM authentication will
@@ -172,36 +100,24 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
-<%- if sshd_agent_forwarding.to_s == 'yes' then -%>
-AllowAgentForwarding yes
-<%- else -%>
-AllowAgentForwarding no
-<%- end -%>
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index fb58e72948088b827cdd10a3d25f39312144c41a..b2eb80158a9aa308b1b37cc0a6515f3c949c99f2 100644 (file)
@@ -3,21 +3,21 @@
 # Package generated configuration file
 # See the sshd(8) manpage for details
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 Protocol 2
@@ -37,115 +37,47 @@ LogLevel INFO
 
 # Authentication:
 LoginGraceTime 120
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 # For this to work you will also need host keys in /etc/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
 #IgnoreUserKnownHosts yes
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to yes to enable challenge-response passwords (beware issues with
 # some PAM modules and threads)
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # Kerberos options
-<%- if sshd_kerberos_authentication.to_s == 'yes' then -%>
-KerberosAuthentication yes
-<%- else -%>
-KerberosAuthentication no
-<%- end -%>
-<%- if sshd_kerberos_orlocalpasswd.to_s == 'yes' then -%>
-KerberosOrLocalPasswd yes
-<%- else -%>
-KerberosOrLocalPasswd no
-<%- end -%>
-<%- if sshd_kerberos_ticketcleanup.to_s == 'yes' then -%>
-KerberosTicketCleanup yes
-<%- else -%>
-KerberosTicketCleanup no
-<%- end -%>
+KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_aorlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
 
 # GSSAPI options
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPIAuthentication yes
-<%- else -%>
-GSSAPIAuthentication no
-<%- end -%>
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPICleanupCredentials yes
-<%- else -%>
-GSSAPICleanupCredentials yes
-<%- end -%>
+GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
 
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 X11DisplayOffset 10
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 PrintLastLog yes
 TCPKeepAlive yes
 
@@ -157,11 +89,7 @@ TCPKeepAlive yes
 # Allow client to pass locale environment variables
 AcceptEnv LANG LC_*
 
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
 
 # Set this to 'yes' to enable PAM authentication, account processing,
 # and session processing. If this is enabled, PAM authentication will
@@ -172,36 +100,24 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
-<%- if sshd_agent_forwarding.to_s == 'yes' then -%>
-AllowAgentForwarding yes
-<%- else -%>
-AllowAgentForwarding no
-<%- end -%>
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
deleted file mode 120000 (symlink)
index 3faae053c33452fc8692e30cd9d493f27df9139b..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-Debian_sid.erb
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..9fc34d44e5b813d36496a050e88b6a02fdd1ffad
--- /dev/null
@@ -0,0 +1,123 @@
+# This file is managed by Puppet, all local modifications will be overwritten
+#
+# Package generated configuration file
+# See the sshd(8) manpage for details
+
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
+
+# What ports, IPs and protocols we listen for
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
+#Port -- disabled by puppet
+<% else -%>
+Port <%= port %>
+<% end -%>
+<% end -%>
+
+# Use these options to restrict which interfaces/protocols sshd will bind to
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+ListenAddress <%= address %>
+<% end -%>
+Protocol 2
+# HostKeys for protocol version 2
+HostKey /etc/ssh/ssh_host_rsa_key
+HostKey /etc/ssh/ssh_host_dsa_key
+#Privilege Separation is turned on for security
+UsePrivilegeSeparation yes
+
+# Lifetime and size of ephemeral version 1 server key
+KeyRegenerationInterval 3600
+ServerKeyBits 768
+
+# Logging
+SyslogFacility AUTH
+LogLevel INFO
+
+# Authentication:
+LoginGraceTime 600
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+
+# Don't read the user's ~/.rhosts and ~/.shosts files
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+# For this to work you will also need host keys in /etc/ssh_known_hosts
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+# similar for protocol version 2
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
+#IgnoreUserKnownHosts yes
+
+# To enable empty passwords, change to yes (NOT RECOMMENDED)
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+
+# Kerberos options
+KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_aorlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+
+# GSSAPI options
+GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11DisplayOffset 10
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintLastLog yes
+TCPKeepAlive yes
+
+#UseLogin no
+
+#MaxStartups 10:30:60
+#Banner /etc/issue.net
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
+<%- end -%>
+
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+Ciphers aes256-ctr
+MACs hmac-sha1
+<% end -%>
+
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index 9853f5da379d78845fc56bc9aecdc728ffbeecfb..9b98aec799e2cf9cac8dd42b134a7e03a8aa3b8e 100644 (file)
 
 #VersionAddendum FreeBSD-20100308
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 #AddressFamily any
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 
@@ -55,52 +55,24 @@ LogLevel INFO
 # Authentication:
 
 LoginGraceTime 600
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
 #MaxAuthTries 6
 #MaxSessions 10
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Change to yes if you don't trust ~/.ssh/known_hosts for
 # RhostsRSAAuthentication and HostbasedAuthentication
@@ -109,53 +81,21 @@ HostbasedAuthentication no
 #IgnoreRhosts yes
 
 # Change to yes to enable built-in password authentication.
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable PAM authentication
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # Kerberos options
-<%- if sshd_kerberos_authentication.to_s == 'yes' then -%>
-KerberosAuthentication yes
-<%- else -%>
-KerberosAuthentication no
-<%- end -%>
-<%- if sshd_kerberos_orlocalpasswd.to_s == 'yes' then -%>
-KerberosOrLocalPasswd yes
-<%- else -%>
-KerberosOrLocalPasswd no
-<%- end -%>
-<%- if sshd_kerberos_ticketcleanup.to_s == 'yes' then -%>
-KerberosTicketCleanup yes
-<%- else -%>
-KerberosTicketCleanup no
-<%- end -%>
+KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_aorlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
 
 # GSSAPI options
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPIAuthentication yes
-<%- else -%>
-GSSAPIAuthentication no
-<%- end -%>
-<%- if sshd_gssapi_authentication.to_s == 'yes' then -%>
-GSSAPICleanupCredentials yes
-<%- else -%>
-GSSAPICleanupCredentials yes
-<%- end -%>
+GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
 
 # Set this to 'no' to disable PAM authentication, account processing,
 # and session processing. If this is enabled, PAM authentication will 
@@ -166,30 +106,14 @@ GSSAPICleanupCredentials yes
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
-<%- if sshd_agent_forwarding.to_s == 'yes' then -%>
-AllowAgentForwarding yes
-<%- else -%>
-AllowAgentForwarding no
-<%- end -%>
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
 #GatewayPorts no
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 
 X11DisplayOffset 10
 #X11UseLocalhost yes
@@ -212,11 +136,7 @@ TCPKeepAlive yes
 #Banner none
 
 # override default of no subsystems
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/libexec/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
 
 # Example of overriding settings on a per-user basis
 #Match User anoncvs
@@ -224,20 +144,18 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 #      AllowTcpForwarding no
 #      ForceCommand cvs server
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
 
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
-
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
-
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% end -%>
 
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index 8581804c9cca57be1032d7747fdab81b133afedb..1cb45227c7a707db210d8b004629e61076c0a388 100644 (file)
 # possible, but leave them commented.  Uncommented options change a
 # default value.
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 #AddressFamily any
@@ -51,84 +51,39 @@ Protocol 2
 # Authentication:
 
 #LoginGraceTime 2m
-PermitRootLogin without-password
-
-<%- if sshd_strict_modes.to_s == 'yes' then %>
-StrictModes yes
-<%- else %>
-StrictModes no
-<%- end %>
-
-<%- unless sshd_permit_root_login.to_s.empty? then %>
-PermitRootLogin <%= sshd_permit_root_login %>
-<%- else %>
-PermitRootLogin without-password
-<%- end %>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+
 #MaxAuthTries 6
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then %>
-RSAAuthentication yes
-<%- else %>
-RSAAuthentication no
-<%- end %>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then %>
-PubkeyAuthentication yes
-<%- else %>
-PubkeyAuthentication no
-<%- end %>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then %>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else %>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end %>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then %>
-RhostsRSAAuthentication yes
-<%- else %>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then %>
-HostbasedAuthentication yes
-<%- else %>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Change to yes if you don't trust ~/.ssh/known_hosts for
 # RhostsRSAAuthentication and HostbasedAuthentication
 #IgnoreUserKnownHosts no
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then %>
-IgnoreRhosts yes
-<%- else %>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then %>
-PasswordAuthentication yes
-<%- else %>
-PasswordAuthentication no
-<%- end %>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then %>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then %>
-ChallengeResponseAuthentication yes
-<%- else %>
-ChallengeResponseAuthentication no
-<%- end %>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # Kerberos options
 #KerberosAuthentication no
@@ -151,27 +106,15 @@ ChallengeResponseAuthentication no
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then %>
-UsePAM yes
-<%- else %>
-UsePAM no
-<%- end %>
-
-<%- if sshd_tcp_forwarding.to_s == 'yes' then %>
-AllowTcpForwarding yes
-<%- else %>
-AllowTcpForwarding no
-<%- end %>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
 #GatewayPorts no
-<%- if sshd_x11_forwarding.to_s == 'yes' then %>
-X11Forwarding yes
-<%- else %>
-X11Forwarding no
-<%- end %>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 #X11DisplayOffset 10
 #X11UseLocalhost yes
-PrintMotd <%= sshd_print_motd %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 #PrintLastLog yes
 #TCPKeepAlive yes
 #UseLogin no
@@ -189,11 +132,7 @@ PrintMotd <%= sshd_print_motd %>
 #Banner /some/path
 
 # override default of no subsystems
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/misc/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/misc/sftp-server' : s %>
 
 # Example of overriding settings on a per-user basis
 #Match User anoncvs
@@ -201,18 +140,19 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 #      AllowTcpForwarding no
 #      ForceCommand cvs server
 
-<%- unless sshd_allowed_users.to_s.empty? then %>
-AllowUsers <%= sshd_allowed_users %>
-<%- end %>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
+<%- end -%>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
+
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
index b6def87cd553e5661af0dd4a39c2b2f91cb8b8fe..6b474d7bd52dffcad0dffe0baf8d171520f2566d 100644 (file)
@@ -8,20 +8,20 @@
 # possible, but leave them commented.  Uncommented options change a
 # default value.
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 #Protocol 2,1
@@ -45,83 +45,39 @@ ListenAddress <%= address %>
 # Authentication:
 
 #LoginGraceTime 2m
-<%- unless sshd_permit_root_login.to_s.empty? then %>
-PermitRootLogin <%= sshd_permit_root_login %>
-<%- else %>
-PermitRootLogin without-password
-<%- end %>
-
-<%- if sshd_strict_modes.to_s == 'yes' then %>
-StrictModes yes
-<%- else %>
-StrictModes no
-<%- end %>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
 #MaxAuthTries 6
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then %>
-RSAAuthentication yes
-<%- else %>
-RSAAuthentication no
-<%- end %>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then %>
-PubkeyAuthentication yes
-<%- else %>
-PubkeyAuthentication no
-<%- end %>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then %>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else %>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end %>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then %>
-RhostsRSAAuthentication yes
-<%- else %>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then %>
-HostbasedAuthentication yes
-<%- else %>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Change to yes if you don't trust ~/.ssh/known_hosts for
 # RhostsRSAAuthentication and HostbasedAuthentication
 #IgnoreUserKnownHosts no
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then %>
-IgnoreRhosts yes
-<%- else %>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then %>
-PasswordAuthentication yes
-<%- else %>
-PasswordAuthentication no
-<%- end %>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then %>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then %>
-ChallengeResponseAuthentication yes
-<%- else %>
-ChallengeResponseAuthentication no
-<%- end %>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # Kerberos options
 #KerberosAuthentication no
@@ -133,18 +89,10 @@ ChallengeResponseAuthentication no
 #GSSAPIAuthentication no
 #GSSAPICleanupCredentials yes
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then %>
-AllowTcpForwarding yes
-<%- else %>
-AllowTcpForwarding no
-<%- end %>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
 #GatewayPorts no
-<%- if sshd_x11_forwarding.to_s == 'yes' then %>
-X11Forwarding yes
-<%- else %>
-X11Forwarding no
-<%- end %>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 #X11DisplayOffset 10
 #X11UseLocalhost yes
 PrintMotd <%= sshd_print_motd %>
@@ -165,18 +113,14 @@ PrintMotd <%= sshd_print_motd %>
 #Banner /some/path
 
 # override default of no subsystems
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/libexec/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
-
-<%- unless sshd_allowed_users.to_s.empty? then %>
-AllowUsers <%= sshd_allowed_users %>
-<%- end %>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/libexec/sftp-server' : s %>
+
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
+<%- end -%>
 
 # Example of overriding settings on a per-user basis
 #Match User anoncvs
@@ -184,11 +128,11 @@ AllowGroups <%= sshd_allowed_groups %>
 #      AllowTcpForwarding no
 #      ForceCommand cvs server
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
 Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end -%>
+<% end -%>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
deleted file mode 120000 (symlink)
index 11b0acc3d34cb7781a4aaf30dfe1e827245be55e..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-Debian_squeeze.erb
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..b2eb80158a9aa308b1b37cc0a6515f3c949c99f2
--- /dev/null
@@ -0,0 +1,123 @@
+# This file is managed by Puppet, all local modifications will be overwritten
+#
+# Package generated configuration file
+# See the sshd(8) manpage for details
+
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
+
+# What ports, IPs and protocols we listen for
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
+#Port -- disabled by puppet
+<% else -%>
+Port <%= port %>
+<% end -%>
+<% end -%>
+
+# Use these options to restrict which interfaces/protocols sshd will bind to
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
+ListenAddress <%= address %>
+<% end -%>
+Protocol 2
+# HostKeys for protocol version 2
+HostKey /etc/ssh/ssh_host_rsa_key
+HostKey /etc/ssh/ssh_host_dsa_key
+#Privilege Separation is turned on for security
+UsePrivilegeSeparation yes
+
+# Lifetime and size of ephemeral version 1 server key
+KeyRegenerationInterval 3600
+ServerKeyBits 768
+
+# Logging
+SyslogFacility AUTH
+LogLevel INFO
+
+# Authentication:
+LoginGraceTime 120
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
+
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
+
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
+
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
+
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
+
+# Don't read the user's ~/.rhosts and ~/.shosts files
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
+# For this to work you will also need host keys in /etc/ssh_known_hosts
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
+# similar for protocol version 2
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
+# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
+#IgnoreUserKnownHosts yes
+
+# To enable empty passwords, change to yes (NOT RECOMMENDED)
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
+
+# Change to yes to enable challenge-response passwords (beware issues with
+# some PAM modules and threads)
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
+
+# To disable tunneled clear text passwords, change to no here!
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
+
+# Kerberos options
+KerberosAuthentication <%= scope.lookupvar('sshd::kerberos_authentication') %>
+KerberosOrLocalPasswd <%= scope.lookupvar('sshd::kerberos_aorlocalpasswd') %>
+KerberosTicketCleanup <%= scope.lookupvar('sshd::kerberos_ticketcleanup') %>
+
+# GSSAPI options
+GSSAPIAuthentication <%= scope.lookupvar('sshd::gssapi_authentication') %>
+GSSAPICleanupCredentials <%= scope.lookupvar('sshd::gssapi_cleanupcredentials') %>
+
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
+X11DisplayOffset 10
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
+PrintLastLog yes
+TCPKeepAlive yes
+
+#UseLogin no
+
+#MaxStartups 10:30:60
+#Banner /etc/issue.net
+
+# Allow client to pass locale environment variables
+AcceptEnv LANG LC_*
+
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
+
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
+
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
+
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
+<%- end -%>
+
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+Ciphers aes256-ctr
+MACs hmac-sha1
+<% end -%>
+
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
index 304558b233b8ea46d4c0d9ec19baa24bddab9b33..cc6e921b4d28d59545ffae0711908fd60d65ec29 100644 (file)
@@ -1,21 +1,21 @@
 # Package generated configuration file
 # See the sshd(8) manpage for details
 
-<%- unless sshd_head_additional_options.to_s.empty? then %>
-<%= sshd_head_additional_options %>
-<%- end %>
+<% unless (s=scope.lookupvar('sshd::head_additional_options')).empty? -%>
+<%= s %>
+<% end -%>
 
 # What ports, IPs and protocols we listen for
-<%- sshd_ports.each do |port| -%>
-<%- if port.to_s == 'off' then -%>
+<% scope.lookupvar('sshd::ports').to_a.each do |port| -%>
+<% if port == 'off' -%>
 #Port -- disabled by puppet
 <% else -%>
 Port <%= port %>
 <% end -%>
-<%- end -%>
+<% end -%>
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
-<% for address in sshd_listen_address -%>
+<% scope.lookupvar('sshd::listen_address').to_a.each do |address| -%>
 ListenAddress <%= address %>
 <% end -%>
 Protocol 2
@@ -39,80 +39,36 @@ LogLevel INFO
 
 # Authentication:
 LoginGraceTime 600
-<%- unless sshd_permit_root_login.to_s.empty? then -%>
-PermitRootLogin <%= sshd_permit_root_login -%>
-<%- else -%>
-PermitRootLogin without-password
-<%- end -%>
+PermitRootLogin <%= scope.lookupvar('sshd::permit_root_login') %>
 
-<%- if sshd_strict_modes.to_s == 'yes' then -%>
-StrictModes yes
-<%- else -%>
-StrictModes no
-<%- end -%>
+StrictModes <%= scope.lookupvar('sshd::strict_modes') %>
 
-<%- if sshd_rsa_authentication.to_s == 'yes' then -%>
-RSAAuthentication yes
-<%- else -%>
-RSAAuthentication no
-<%- end -%>
+RSAAuthentication <%= scope.lookupvar('sshd::rsa_authentication') %>
 
-<%- if sshd_pubkey_authentication.to_s == 'yes' then -%>
-PubkeyAuthentication yes
-<%- else -%>
-PubkeyAuthentication no
-<%- end -%>
+PubkeyAuthentication <%= scope.lookupvar('sshd::pubkey_authentication') %>
 
-<%- unless sshd_authorized_keys_file.to_s.empty? then -%>
-AuthorizedKeysFile <%= sshd_authorized_keys_file %>
-<%- else -%>
-AuthorizedKeysFile %h/.ssh/authorized_keys
-<%- end -%>
+AuthorizedKeysFile <%= scope.lookupvar('sshd::authorized_keys_file') %>
 
 # For this to work you will also need host keys in /etc/ssh_known_hosts
-<%- if sshd_rhosts_rsa_authentication.to_s == 'yes' then -%>
-RhostsRSAAuthentication yes
-<%- else -%>
-RhostsRSAAuthentication no
-<% end -%>
+RhostsRSAAuthentication <%= scope.lookupvar('sshd::rhosts_rsa_authentication') %>
 
 # Don't read the user's ~/.rhosts and ~/.shosts files
-<%- if sshd_ignore_rhosts.to_s == 'yes' then -%>
-IgnoreRhosts yes
-<%- else -%>
-IgnoreRhosts no
-<% end -%>
+IgnoreRhosts <%= scope.lookupvar('sshd::ignore_rhosts') %>
 
 # similar for protocol version 2
-<%- if sshd_hostbased_authentication.to_s == 'yes' then -%>
-HostbasedAuthentication yes
-<%- else -%>
-HostbasedAuthentication no
-<% end -%>
+HostbasedAuthentication <%= scope.lookupvar('sshd::hostbased_authentication') %>
 
 # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
 #IgnoreUserKnownHosts yes
 
 # To enable empty passwords, change to yes (NOT RECOMMENDED)
-<%- if sshd_permit_empty_passwords.to_s == 'yes' then -%>
-PermitEmptyPasswords yes
-<% else -%>
-PermitEmptyPasswords no
-<% end -%>
+PermitEmptyPasswords <%= scope.lookupvar('sshd::permit_empty_passwords') %>
 
 # Change to no to disable s/key passwords
-<%- if sshd_challenge_response_authentication.to_s == 'yes' then -%>
-ChallengeResponseAuthentication yes
-<%- else -%>
-ChallengeResponseAuthentication no
-<%- end -%>
+ChallengeResponseAuthentication <%= scope.lookupvar('sshd::challenge_response_authentication') %>
 
 # To disable tunneled clear text passwords, change to no here!
-<%- if sshd_password_authentication.to_s == 'yes' then -%>
-PasswordAuthentication yes
-<%- else -%>
-PasswordAuthentication no
-<%- end -%>
+PasswordAuthentication <%= scope.lookupvar('sshd::password_authentication') %>
 
 # To change Kerberos options
 #KerberosAuthentication no
@@ -123,11 +79,7 @@ PasswordAuthentication no
 # Kerberos TGT Passing does only work with the AFS kaserver
 #KerberosTgtPassing yes
 
-<%- if sshd_x11_forwarding.to_s == 'yes' then -%>
-X11Forwarding yes
-<%- else -%>
-X11Forwarding no
-<%- end -%>
+X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
 X11DisplayOffset 10
 KeepAlive yes
 #UseLogin no
@@ -136,11 +88,7 @@ KeepAlive yes
 #Banner /etc/issue.net
 #ReverseMappingCheck yes
 
-<%- if sshd_sftp_subsystem.to_s.empty? then %>
-Subsystem      sftp    /usr/lib/openssh/sftp-server
-<%- else %>
-Subsystem      sftp    <%= sshd_sftp_subsystem %>
-<%- end %>
+Subsystem      sftp    <%= (s=scope.lookupvar('sshd::sftp_subsystem')).empty? ? '/usr/lib/openssh/sftp-server' : s %>
 
 # Set this to 'yes' to enable PAM authentication, account processing, 
 # and session processing. If this is enabled, PAM authentication will 
@@ -151,42 +99,28 @@ Subsystem      sftp    <%= sshd_sftp_subsystem %>
 # If you just want the PAM account and session checks to run without
 # PAM authentication, then enable this but set PasswordAuthentication
 # and ChallengeResponseAuthentication to 'no'.
-<%- if sshd_use_pam.to_s == 'yes' then -%>
-UsePAM yes
-<%- else -%>
-UsePAM no
-<%- end -%>
+UsePAM <%= scope.lookupvar('sshd::use_pam') %>
 
 HostbasedUsesNameFromPacketOnly yes
 
-<%- if sshd_tcp_forwarding.to_s == 'yes' then -%>
-AllowTcpForwarding yes
-<%- else -%>
-AllowTcpForwarding no
-<%- end -%>
-
-<%- if sshd_agent_forwarding.to_s == 'yes' then -%>
-AllowAgentForwarding yes
-<%- else -%>
-AllowAgentForwarding no
-<%- end -%>
+AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
 
-ChallengeResponseAuthentication no
+AllowAgentForwarding <%= scope.lookupvar('sshd::agent_forwarding') %>
 
-<%- unless sshd_allowed_users.to_s.empty? then -%>
-AllowUsers <%= sshd_allowed_users -%>
+<% unless (s=scope.lookupvar('sshd::allowed_users')).empty? -%>
+AllowUsers <%= s %>
+<% end -%>
+<% unless (s=scope.lookupvar('sshd::allowed_groups')).empty? -%>
+AllowGroups <%= s %>
 <%- end -%>
-<%- unless sshd_allowed_groups.to_s.empty? then %>
-AllowGroups <%= sshd_allowed_groups %>
-<%- end %>
-
-PrintMotd <%= sshd_print_motd %>
 
-<%- unless sshd_tail_additional_options.to_s.empty? then %>
-<%= sshd_tail_additional_options %>
-<%- end %>
+PrintMotd <%= scope.lookupvar('sshd::print_motd') %>
 
-<%- if sshd_hardened_ssl.to_s == 'yes' then -%>
-Ciphers aes128-ctr
+<% if scope.lookupvar('sshd::hardened_ssl') == 'yes' -%>
+Ciphers aes256-ctr
 MACs hmac-sha1
-<%- end %>
+<% end -%>
+
+<% unless (s=scope.lookupvar('sshd::tail_additional_options')).empty? -%>
+<%= s %>
+<% end -%>