munin: Rename autoconfig parameter as force, actually enable plugin
This commit is contained in:
parent
fc677aae3d
commit
1addc43bfe
1 changed files with 15 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue