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 {
|
|
|
|
|
2008-01-02 21:02:15 +01:00
|
|
|
case $operatingsystem {
|
|
|
|
OpenBSD: {
|
|
|
|
service{'sshd':
|
|
|
|
enable => true,
|
|
|
|
ensure => running,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
default: {
|
|
|
|
service{'sshd':
|
|
|
|
enable => true,
|
|
|
|
ensure => running,
|
|
|
|
require => Package[openssh],
|
|
|
|
}
|
|
|
|
|
|
|
|
package{openssh:
|
|
|
|
name => $operatingsystem ? {
|
|
|
|
centos => openssh-server,
|
|
|
|
default => openssh,
|
|
|
|
},
|
|
|
|
alias => 'openssh',
|
|
|
|
category => $operatingsystem ? {
|
|
|
|
gentoo => 'net-misc',
|
|
|
|
default => '',
|
|
|
|
},
|
|
|
|
ensure => present,
|
|
|
|
}
|
|
|
|
}
|
2008-01-02 20:40:42 +01:00
|
|
|
}
|
2008-01-02 21:02:15 +01:00
|
|
|
|
|
|
|
|
2007-12-21 18:52:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
define sshd::sshd_config (
|
2007-12-27 16:42:16 +01:00
|
|
|
$source = "",
|
2007-12-27 16:53:51 +01:00
|
|
|
$allowed_users = 'root'
|
2007-12-21 18:52:01 +01:00
|
|
|
){
|
|
|
|
$real_source = $source ? {
|
2007-12-27 16:42:16 +01:00
|
|
|
'' => "${operatingsystem}_normal.erb",
|
2007-12-21 18:52:01 +01:00
|
|
|
default => $source,
|
|
|
|
}
|
|
|
|
|
|
|
|
file { 'sshd_config':
|
|
|
|
path => '/etc/ssh/sshd_config',
|
|
|
|
owner => root,
|
|
|
|
group => 0,
|
|
|
|
mode => 600,
|
2007-12-27 16:57:33 +01:00
|
|
|
content => template("sshd/sshd_config/${real_source}"),
|
2007-12-21 19:21:22 +01:00
|
|
|
notify => Service[sshd],
|
2007-12-21 18:52:01 +01:00
|
|
|
}
|
|
|
|
}
|