Make ipv6 munin things work
authorPeter Palfrader <peter@palfrader.org>
Fri, 10 Feb 2012 00:34:48 +0000 (01:34 +0100)
committerPeter Palfrader <peter@palfrader.org>
Fri, 10 Feb 2012 00:34:48 +0000 (01:34 +0100)
modules/ferm/manifests/init.pp

index a6dcf1e..c52fa5e 100644 (file)
@@ -70,6 +70,26 @@ class ferm {
         $munin_ips: script => "ip_";
     }
 
+    define munin_ipv6_plugin() {
+        file {
+            "/etc/munin/plugins/$name":
+                content =>  "#!/bin/bash\n# This file is under puppet control\n. /usr/share/munin/plugins/ip_\n",
+                mode => 555,
+                notify => Exec["munin-node restart"],
+                ;
+        }
+    }
+    case $v6ips {
+        'no': {}
+        default: {
+           $munin6_ips = split(regsubst($v6ips, '([^,]+)', 'ip_\1', 'G'), ',')
+            munin_ipv6_plugin {
+                $munin6_ips: ;
+            }
+        }
+    }
+
+
     case getfromhash($nodeinfo, 'buildd') {
         true: {
             file {
@@ -81,16 +101,6 @@ class ferm {
         }
     }
 
-    case $v6ips {
-        'no': {}
-        default: {
-            $munin6_ips = split(regsubst($v6ips, '([^,]+)', 'ip6_\1', 'G'), ',')
-            activate_munin_check {
-                $munin6_ips: script => "ip6_";
-            }
-        }
-    }
-
     exec {
         "ferm restart":
             command     => "/etc/init.d/ferm restart",