From a48040c5448b5a91951e60f5af74245d61b429e0 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Fri, 19 Jul 2013 10:41:51 +0300 Subject: [PATCH] munin: Added automatic configuration to munin::snmpnode --- munin/manifests/init.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/munin/manifests/init.pp b/munin/manifests/init.pp index 786418a..a9d062f 100644 --- a/munin/manifests/init.pp +++ b/munin/manifests/init.pp @@ -123,7 +123,15 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") { default => "root", }, mode => "0600", - notify => Service["munin-node"], + notify => Exec["munin-snmp-configure-${name}"], + } + + exec { "munin-snmp-configure-${name}": + path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin", + command => "munin-node-configure --snmp ${name} --snmpcommunity ${snmp_community} --shell 2>/dev/null | /bin/sh", + user => "root", + refreshonly => true, + notify => Service["munin-node"], } @@file { "/etc/munin/conf.d/${name}.conf":