munin: Add autoconfig parameter for munin::plugin
This commit is contained in:
parent
fad562fc8a
commit
fc677aae3d
1 changed files with 16 additions and 4 deletions
|
@ -151,6 +151,8 @@ 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:
|
||||||
|
# Boolean for triggering munin-node-configure. Defaults to true.
|
||||||
# $source:
|
# $source:
|
||||||
# Source path of the plugin.
|
# Source path of the plugin.
|
||||||
# $config:
|
# $config:
|
||||||
|
@ -163,7 +165,17 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
||||||
# config => "puppet:///files/munin/plugins/nagios_multi_.conf",
|
# 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 {
|
if $enable == true {
|
||||||
case $::operatingsystem {
|
case $::operatingsystem {
|
||||||
|
@ -185,7 +197,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) {
|
||||||
default => "root",
|
default => "root",
|
||||||
},
|
},
|
||||||
source => $source,
|
source => $source,
|
||||||
notify => Exec["munin-node-configure"],
|
notify => $notify,
|
||||||
require => Package["munin-node"],
|
require => Package["munin-node"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,7 +212,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) {
|
||||||
default => "root",
|
default => "root",
|
||||||
},
|
},
|
||||||
source => $config,
|
source => $config,
|
||||||
notify => Exec["munin-node-configure"],
|
notify => $notify,
|
||||||
require => Package["munin-node"],
|
require => Package["munin-node"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +226,7 @@ define munin::plugin($enable=true, $source=undef, $config=undef) {
|
||||||
default => "root",
|
default => "root",
|
||||||
},
|
},
|
||||||
content => "[${name}]\ncommand /bin/true\n",
|
content => "[${name}]\ncommand /bin/true\n",
|
||||||
notify => Exec["munin-node-configure"],
|
notify => $notify,
|
||||||
require => Package["munin-node"],
|
require => Package["munin-node"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue