summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-10-16 16:05:00 +0200
committerintrigeri <intrigeri@boum.org>2010-10-16 16:05:00 +0200
commita643172a794c9a1ff7602e9b4d3b220867684f54 (patch)
treed21da4b82ab1c779d0a9b357143c0e4878589334 /manifests/init.pp
parent23efb583bf565f12361e929f1a2d1fca61f4d3bb (diff)
New option sshd_ports that obsoletes sshd_port.
Backward compatibility is preserved.
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp22
1 files changed, 17 insertions, 5 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 4f82542..abb1490 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -118,8 +118,11 @@
# Valid Values: yes or no
# Default: no
#
-# sshd_port: If you want to specify a different port than the default 22
-# Default: 22
+# sshd_port: Deprecated, use sshd_ports instead.
+#
+# sshd_ports: If you want to specify a list of ports other than the default 22
+# Default: [22]
+#
#
# sshd_authorized_keys_file: Set this to the location of the AuthorizedKeysFile (e.g. /etc/ssh/authorized_keys/%u)
# Default: AuthorizedKeysFile %h/.ssh/authorized_keys
@@ -193,8 +196,14 @@ class sshd {
case $sshd_permit_empty_passwords {
'': { $sshd_permit_empty_passwords = 'no' }
}
- case $sshd_port {
- '': { $sshd_port = 22 }
+ if ( $sshd_port != '' ) && ( $sshd_ports != []) {
+ err("Cannot use sshd_port and sshd_ports at the same time.")
+ }
+ if $sshd_port != '' {
+ $sshd_ports = [ $sshd_port ]
+ }
+ elsif $sshd_port == [] {
+ $sshd_ports = [ 22 ]
}
case $sshd_authorized_keys_file {
'': { $sshd_authorized_keys_file = "%h/.ssh/authorized_keys" }
@@ -224,9 +233,12 @@ class sshd {
}
if $use_nagios {
+ define sshd::nagios {
+ nagios::service{ "ssh_port_${name}": check_command => "check_ssh_port!$name" }
+ }
case $nagios_check_ssh {
false: { info("We don't do nagioschecks for ssh on ${fqdn}" ) }
- default: { nagios::service{ "ssh_port_${sshd_port}": check_command => "check_ssh_port!$sshd_port" } }
+ default: { sshd::nagios($sshd_ports:) }
}
}