6f59d15abf
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@346 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
48 lines
1.1 KiB
Puppet
48 lines
1.1 KiB
Puppet
# 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 => $operatingsystem ? {
|
|
openbsd => '',
|
|
default => Package[openssh],
|
|
}
|
|
}
|
|
|
|
package{openssh:
|
|
name => $operatingsystem ? {
|
|
centos => openssh-server,
|
|
default => openssh,
|
|
},
|
|
alias => 'openssh',
|
|
category => $operatingsystem ? {
|
|
gentoo => 'net-misc',
|
|
default => '',
|
|
},
|
|
ensure => present,
|
|
}
|
|
}
|
|
|
|
define sshd::sshd_config (
|
|
$source = "",
|
|
$allowed_users = 'root'
|
|
){
|
|
$real_source = $source ? {
|
|
'' => "${operatingsystem}_normal.erb",
|
|
default => $source,
|
|
}
|
|
|
|
file { 'sshd_config':
|
|
path => '/etc/ssh/sshd_config',
|
|
owner => root,
|
|
group => 0,
|
|
mode => 600,
|
|
content => template("sshd/sshd_config/${real_source}"),
|
|
notify => Service[sshd],
|
|
}
|
|
}
|