From fc677aae3dc4aa0fcea614b561867be67c3b0453 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 27 Oct 2014 13:26:06 +0200 Subject: [PATCH] munin: Add autoconfig parameter for munin::plugin --- munin/manifests/init.pp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/munin/manifests/init.pp b/munin/manifests/init.pp index a9d062f..3319a0c 100644 --- a/munin/manifests/init.pp +++ b/munin/manifests/init.pp @@ -151,6 +151,8 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") { # Plugin name to install. # $enable: # Set to false to disable plugin. +# $autoconfig: +# Boolean for triggering munin-node-configure. Defaults to true. # $source: # Source path of the plugin. # $config: @@ -163,7 +165,17 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") { # config => "puppet:///files/munin/plugins/nagios_multi_.conf", # } # -define munin::plugin($enable=true, $source=undef, $config=undef) { +define munin::plugin( + $enable=true, + $autoconfig=true, + $source=undef, + $config=undef, +) { + + $notify = $autoconfig ? { + true => Exec["munin-node-configure"], + default => undef, + } if $enable == true { case $::operatingsystem { @@ -185,7 +197,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) { default => "root", }, source => $source, - notify => Exec["munin-node-configure"], + notify => $notify, require => Package["munin-node"], } } @@ -200,7 +212,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) { default => "root", }, source => $config, - notify => Exec["munin-node-configure"], + notify => $notify, require => Package["munin-node"], } } @@ -214,7 +226,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) { default => "root", }, content => "[${name}]\ncommand /bin/true\n", - notify => Exec["munin-node-configure"], + notify => $notify, require => Package["munin-node"], } }