From 1addc43bfe440db2e1b094b187112c717e52a29e Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Mon, 27 Oct 2014 13:54:47 +0200 Subject: [PATCH] munin: Rename autoconfig parameter as force, actually enable plugin --- munin/manifests/init.pp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/munin/manifests/init.pp b/munin/manifests/init.pp index 3319a0c..df6a681 100644 --- a/munin/manifests/init.pp +++ b/munin/manifests/init.pp @@ -151,8 +151,9 @@ 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. +# $force: +# Skip munin-node-configure and always enable plugin if true. +# Defaults to false. # $source: # Source path of the plugin. # $config: @@ -167,14 +168,14 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") { # define munin::plugin( $enable=true, - $autoconfig=true, + $force=false, $source=undef, $config=undef, ) { - $notify = $autoconfig ? { - true => Exec["munin-node-configure"], - default => undef, + $notify = $force ? { + true => undef, + default => Exec["munin-node-configure"], } if $enable == true { @@ -216,6 +217,14 @@ define munin::plugin( require => Package["munin-node"], } } + + if $force == true { + file { "/etc/munin/plugins/${name}": + ensure => link, + target => "${plugindir}/${name}", + notify => Service["munin-node"], + } + } } else { file { "/etc/munin/plugin-conf.d/${name}": ensure => present,