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.
|
# Plugin name to install.
|
||||||
# $enable:
|
# $enable:
|
||||||
# Set to false to disable plugin.
|
# Set to false to disable plugin.
|
||||||
# $autoconfig:
|
# $force:
|
||||||
# Boolean for triggering munin-node-configure. Defaults to true.
|
# Skip munin-node-configure and always enable plugin if true.
|
||||||
|
# Defaults to false.
|
||||||
# $source:
|
# $source:
|
||||||
# Source path of the plugin.
|
# Source path of the plugin.
|
||||||
# $config:
|
# $config:
|
||||||
|
@ -167,14 +168,14 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
||||||
#
|
#
|
||||||
define munin::plugin(
|
define munin::plugin(
|
||||||
$enable=true,
|
$enable=true,
|
||||||
$autoconfig=true,
|
$force=false,
|
||||||
$source=undef,
|
$source=undef,
|
||||||
$config=undef,
|
$config=undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$notify = $autoconfig ? {
|
$notify = $force ? {
|
||||||
true => Exec["munin-node-configure"],
|
true => undef,
|
||||||
default => undef,
|
default => Exec["munin-node-configure"],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $enable == true {
|
if $enable == true {
|
||||||
|
@ -216,6 +217,14 @@ define munin::plugin(
|
||||||
require => Package["munin-node"],
|
require => Package["munin-node"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $force == true {
|
||||||
|
file { "/etc/munin/plugins/${name}":
|
||||||
|
ensure => link,
|
||||||
|
target => "${plugindir}/${name}",
|
||||||
|
notify => Service["munin-node"],
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
file { "/etc/munin/plugin-conf.d/${name}":
|
file { "/etc/munin/plugin-conf.d/${name}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue