Split nagios resources into their own file.
authorGabriel Filion <gabster@lelutin.ca>
Fri, 20 Feb 2015 23:14:21 +0000 (18:14 -0500)
committerGabriel Filion <gabster@lelutin.ca>
Fri, 20 Feb 2015 23:14:21 +0000 (18:14 -0500)
This will make it possible to manage nagios resources from a point
external to this module in order to have more fine-grained control.

manifests/service.pp
manifests/service/nagios.pp [new file with mode: 0644]

index 910f714..fe36c2f 100644 (file)
@@ -72,8 +72,6 @@ define stunnel::service (
   }
 
   if $manage_nagios {
-    nagios::service { "stunnel_${name}":
-      check_command => "nagios-stat-proc!/usr/bin/stunnel4 /etc/stunnel/${name}.conf!6!5!proc";
-    }
+    stunnel::service::nagios { $name: }
   }
 }
diff --git a/manifests/service/nagios.pp b/manifests/service/nagios.pp
new file mode 100644 (file)
index 0000000..578b417
--- /dev/null
@@ -0,0 +1,12 @@
+# Put a Nagios service check in place for a specific tunnel.
+#
+# The resource name will be used to point to the corresponding stunnel
+# configuration file.
+#
+define stunnel::service::nagios () {
+
+    nagios::service { "stunnel_${name}":
+      check_command => "nagios-stat-proc!/usr/bin/stunnel4 /etc/stunnel/${name}.conf!6!5!proc";
+    }
+
+}