module-sshd/manifests/init.pp

86 lines
2.3 KiB
ObjectPascal
Raw Normal View History

2014-06-10 18:31:11 +02:00
# manage an sshd installation
2012-06-05 23:23:03 +02:00
class sshd(
2013-05-26 13:31:27 +02:00
$manage_nagios = false,
2012-06-14 02:52:44 +02:00
$nagios_check_ssh_hostname = 'absent',
$ports = [ 22 ],
$shared_ip = 'no',
$ensure_version = 'installed',
$listen_address = [ '0.0.0.0', '::' ],
$allowed_users = '',
$allowed_groups = '',
$use_pam = 'no',
$permit_root_login = 'without-password',
$password_authentication = 'no',
$kerberos_authentication = 'no',
$kerberos_orlocalpasswd = 'yes',
$kerberos_ticketcleanup = 'yes',
$gssapi_authentication = 'no',
$gssapi_cleanupcredentials = 'yes',
$tcp_forwarding = 'no',
$x11_forwarding = 'no',
$agent_forwarding = 'no',
$challenge_response_authentication = 'no',
$pubkey_authentication = 'yes',
$rsa_authentication = 'no',
$strict_modes = 'yes',
$ignore_rhosts = 'yes',
$rhosts_rsa_authentication = 'no',
$hostbased_authentication = 'no',
$permit_empty_passwords = 'no',
$authorized_keys_file = $::osfamily ? {
Debian => $::operatingsystemmajrelease ? {
6 => '%h/.ssh/authorized_keys',
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
},
RedHat => $::operatingsystemmajrelease ? {
5 => '%h/.ssh/authorized_keys',
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
},
default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2',
},
2012-06-14 02:52:44 +02:00
$hardened_ssl = 'no',
$sftp_subsystem = '',
$head_additional_options = '',
$tail_additional_options = '',
$print_motd = 'yes',
$manage_shorewall = false,
2014-02-14 01:24:15 +01:00
$shorewall_source = 'net',
$sshkey_ipaddress = $::ipaddress,
$manage_client = true,
2012-06-05 23:23:03 +02:00
) {
2014-01-27 00:16:27 +01:00
validate_bool($manage_shorewall)
validate_bool($manage_client)
2014-01-27 00:16:27 +01:00
validate_array($listen_address)
validate_array($ports)
if $manage_client {
class{'sshd::client':
shared_ip => $shared_ip,
ensure_version => $ensure_version,
manage_shorewall => $manage_shorewall,
}
2012-06-05 23:23:03 +02:00
}
2012-06-05 23:23:03 +02:00
case $::operatingsystem {
gentoo: { include sshd::gentoo }
redhat,centos: { include sshd::redhat }
openbsd: { include sshd::openbsd }
debian,ubuntu: { include sshd::debian }
default: { include sshd::base }
}
2012-06-14 02:52:44 +02:00
if $manage_nagios {
sshd::nagios{$ports:
check_hostname => $nagios_check_ssh_hostname
}
}
2009-12-10 23:45:12 +01:00
2012-06-14 02:52:44 +02:00
if $manage_shorewall {
class{'shorewall::rules::ssh':
2013-02-03 00:30:54 +01:00
ports => $ports,
2012-06-14 02:52:44 +02:00
source => $shorewall_source
}
2009-12-10 23:45:12 +01:00
}
}