2007-12-21 18:52:01 +01:00
|
|
|
# modules/ssh/manifests/init.pp - manage ssh stuff
|
|
|
|
# Copyright (C) 2007 admin@immerda.ch
|
|
|
|
#
|
|
|
|
|
|
|
|
modules_dir { "sshd": }
|
|
|
|
|
|
|
|
class sshd {
|
|
|
|
service{'sshd':
|
|
|
|
enable => true,
|
|
|
|
ensure => running,
|
|
|
|
require => Package[openssh],
|
|
|
|
}
|
|
|
|
|
|
|
|
package{ssh:
|
|
|
|
name => $operatingsystem ? {
|
|
|
|
centos => openssh-server,
|
|
|
|
default => openssh,
|
|
|
|
},
|
|
|
|
alias => 'openssh',
|
|
|
|
category => $operatingsystem ? {
|
|
|
|
gentoo => 'net-misc',
|
|
|
|
default => '',
|
|
|
|
},
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
define sshd::sshd_config (
|
|
|
|
$source = ""
|
|
|
|
){
|
|
|
|
$real_source = $source ? {
|
|
|
|
'' => "${operatingsystem}_normal",
|
|
|
|
default => $source,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { 'sshd_config':
|
|
|
|
path => '/etc/ssh/sshd_config',
|
|
|
|
owner => root,
|
|
|
|
group => 0,
|
|
|
|
mode => 600,
|
2007-12-21 19:27:16 +01:00
|
|
|
source => "puppet://$server/sshd/sshd_config/$real_source",
|
2007-12-21 19:21:22 +01:00
|
|
|
notify => Service[sshd],
|
2007-12-21 18:52:01 +01:00
|
|
|
}
|
|
|
|
}
|