module-sshd/manifests/base.pp

42 lines
1.1 KiB
ObjectPascal
Raw Permalink Normal View History

2014-03-14 10:36:24 +01:00
# The base class to setup the common things.
# This is a private class and will always be used
# throught the sshd class itself.
2014-03-14 10:35:02 +01:00
class sshd::base {
2013-02-03 00:30:54 +01:00
$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")
}
2013-02-03 00:30:54 +01:00
}
file { 'sshd_config':
2014-01-26 11:19:11 +01:00
ensure => present,
2013-02-03 00:30:54 +01:00
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
2012-06-05 23:23:03 +02:00
case $::sshrsakey {
'': { info("no sshrsakey on ${::fqdn}") }
default: {
# only export sshkey when storedconfigs is enabled
if $::sshd::use_storedconfigs {
include ::sshd::sshkey
}
2009-09-29 19:53:04 +02:00
}
}
service{'sshd':
2013-02-03 00:30:54 +01:00
ensure => running,
name => 'sshd',
enable => true,
hasstatus => true,
2013-02-03 00:30:54 +01:00
require => File[sshd_config],
}
2009-09-29 19:53:04 +02:00
}