diff options
Diffstat (limited to 'manifests/base.pp')
-rw-r--r-- | manifests/base.pp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 4001985..dda9f26 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -1,41 +1,41 @@ +# The base class to setup the common things. +# This is a private class and will always be used +# throught the sshd class itself. class sshd::base { + + $sshd_config_content = $::operatingsystem ? { + 'CentOS' => template("sshd/sshd_config/${::operatingsystem}_${::operatingsystemmajrelease}.erb"), + default => $::lsbdistcodename ? { + '' => template("sshd/sshd_config/${::operatingsystem}.erb"), + default => template("sshd/sshd_config/${::operatingsystem}_${::lsbdistcodename}.erb") + } + } + file { 'sshd_config': - path => '/etc/ssh/sshd_config', - 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; + ensure => present, + path => '/etc/ssh/sshd_config', + content => $sshd_config_content, + notify => Service[sshd], + owner => root, + group => 0, + mode => '0600'; } # Now add the key, if we've got one case $::sshrsakey { '': { info("no sshrsakey on ${::fqdn}") } default: { - @@sshkey{$::fqdn: - tag => "fqdn", - type => ssh-rsa, - 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: - tag => "ipaddress", - type => ssh-rsa, - key => $::sshrsakey, - ensure => present, - } + # only export sshkey when storedconfigs is enabled + if $::sshd::use_storedconfigs { + include ::sshd::sshkey } } } service{'sshd': - name => 'sshd', - enable => true, - ensure => running, + ensure => running, + name => 'sshd', + enable => true, hasstatus => true, - require => File[sshd_config], + require => File[sshd_config], } } |