unbreak v6 munin check
authorStephen Gran <steve@lobefin.net>
Thu, 5 Apr 2012 13:42:37 +0000 (14:42 +0100)
committerStephen Gran <steve@lobefin.net>
Thu, 5 Apr 2012 13:42:54 +0000 (14:42 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/ferm/manifests/init.pp
modules/munin/manifests/check.pp
modules/munin/manifests/ipv6check.pp [new file with mode: 0644]

index 2ad9750..bb9e81b 100644 (file)
@@ -22,7 +22,7 @@ class ferm {
 
        if $v6ips {
                $munin6_ips = split(regsubst($v6ips, '([^,]+)', 'ip_\1', 'G'), ',')
-               munin::check { $munin6_ips: script => 'ip_', }
+               munin::ipv6check { $munin6_ips: }
        }
 
        # get rid of old stuff
index ee88ca0..d807861 100644 (file)
@@ -1,5 +1,7 @@
 define munin::check($ensure = present, $script = undef) {
 
+       include munin
+
        if $script {
                $link = $script
        } else {
diff --git a/modules/munin/manifests/ipv6check.pp b/modules/munin/manifests/ipv6check.pp
new file mode 100644 (file)
index 0000000..c8bf1b7
--- /dev/null
@@ -0,0 +1,16 @@
+define munin::ipv6check($ensure = present) {
+
+       include munin
+
+       if ! ($ensure in [absent,present]) {
+               fail("unexpected ensure: ${ensure}")
+       }
+
+       file { "/etc/munin/plugins/${name}":
+               ensure  => $ensure,
+               content => "#!/bin/bash\n# This file is under puppet control\n. /usr/share/munin/plugins/ip_\n",
+               mode    => '0555',
+               require => Package['munin-node'],
+               notify  => Service['munin-node'],
+       }
+}