-define munin::check($ensure = present, $script = undef) {
+# enable (or disable) a munin check
+# @param ensure check enabled/disabled
+# @param script check to synclink
+define munin::check(
+ Enum['present','absent'] $ensure = 'present',
+ String $script = $name
+) {
+ include munin
- include munin
+ $link_target = $ensure ? {
+ present => link,
+ absent => absent,
+ }
- if $script {
- $link = $script
- } else {
- $link = $name
- }
-
- $link_target = $ensure ? {
- present => "/usr/share/munin/plugins/${link}",
- absent => absent,
- default => fail ( "Unknown ensure value: '$ensure'" ),
- }
-
- file { "/etc/munin/plugins/${name}":
- ensure => $link_target,
- require => Package['munin-node'],
- notify => Service['munin-node'],
- }
+ file { "/etc/munin/plugins/${name}":
+ ensure => $link_target,
+ target => "/usr/share/munin/plugins/${script}",
+ require => Package['munin-node'],
+ notify => Service['munin-node'],
+ }
}