]> gitweb.fluxo.info Git - puppet-sshd.git/commitdiff
introduce that port also can't be the name, fix ensure problem
authormh <mh@immerda.ch>
Wed, 20 Oct 2010 21:12:43 +0000 (23:12 +0200)
committermh <mh@immerda.ch>
Wed, 20 Oct 2010 21:12:43 +0000 (23:12 +0200)
manifests/nagios.pp

index 1500a0987d985832f9aaf4a35f54eda28e55d396..4971f65c0e222a41209c6c31e4692ce1e7377f41 100644 (file)
@@ -1,18 +1,23 @@
 define sshd::nagios(
+  $port = 'absent',
   $ensure = 'present',
   $check_hostname = 'absent'
 ) {
+  $real_port = $port ? {
+    'absent' => $name,
+    default => $port,
+  }
   case $check_hostname {
     'absent': {
       nagios::service{"ssh_port_${name}":
-        ensure => $esnure,
-        check_command => "check_ssh_port!$name"
+        ensure => $ensure,
+        check_command => "check_ssh_port!$port"
       }
     }
     default: {
-      nagios::service{"ssh_port_host_${name}_${check_hostname}":
-        ensure => $esnure,
-        check_command => "check_ssh_port_host!${name}!${check_hostname}"
+      nagios::service{"ssh_port_host_${name}":
+        ensure => $ensure,
+        check_command => "check_ssh_port_host!${port}!${check_hostname}"
       }
     }
   }