module-sshd/manifests/base.pp

42 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2009-09-29 23:43:42 +02:00
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"),
},
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") }
default: {
2009-12-27 19:30:14 +01:00
@@sshkey{"$fqdn":
2009-12-27 17:23:51 +01:00
tag => "fqdn",
type => ssh-rsa,
key => $sshrsakey,
ensure => present,
}
# In case the node has uses a shared network address,
2009-12-27 17:23:51 +01:00
# we don't define a sshkey resource using an IP address
if $sshd_shared_ip == "no" {
2009-12-27 17:23:51 +01:00
@@sshkey{"$ipaddress":
tag => "ipaddress",
type => ssh-rsa,
key => $sshrsakey,
ensure => present,
}
}
2009-09-29 19:53:04 +02:00
}
}
service{'sshd':
name => 'sshd',
enable => true,
ensure => running,
hasstatus => true,
require => File[sshd_config],
}
2009-09-29 19:53:04 +02:00
}