From a9a817d4b2bfcf600d061ad707010af425b30711 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Thu, 5 Apr 2012 14:42:37 +0100 Subject: [PATCH] unbreak v6 munin check Signed-off-by: Stephen Gran --- modules/ferm/manifests/init.pp | 2 +- modules/munin/manifests/check.pp | 2 ++ modules/munin/manifests/ipv6check.pp | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 modules/munin/manifests/ipv6check.pp diff --git a/modules/ferm/manifests/init.pp b/modules/ferm/manifests/init.pp index 2ad975073..bb9e81b15 100644 --- a/modules/ferm/manifests/init.pp +++ b/modules/ferm/manifests/init.pp @@ -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 diff --git a/modules/munin/manifests/check.pp b/modules/munin/manifests/check.pp index ee88ca0bc..d807861fe 100644 --- a/modules/munin/manifests/check.pp +++ b/modules/munin/manifests/check.pp @@ -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 index 000000000..c8bf1b706 --- /dev/null +++ b/modules/munin/manifests/ipv6check.pp @@ -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'], + } +} -- 2.20.1