diff options
author | am <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279> | 2007-12-05 14:38:01 +0000 |
---|---|---|
committer | am <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279> | 2007-12-05 14:38:01 +0000 |
commit | e8782d1d657dcd2ac5f22b9d996004fecd8529e4 (patch) | |
tree | 702f6b9a22476ae20da2e99ff646d0fdaa8a3ae1 | |
parent | 3444412814ca147bc6a51abea947bf2ad36a4a28 (diff) |
script path correction
git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@204 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
-rw-r--r-- | manifests/plugin.pp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 2b14857..b9a1456 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,20 +4,24 @@ define munin::plugin ( $ensure = "present", - $script_path = "/usr/share/munin/plugins", + $script_path, $config = '') { + $script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } gentoo: { $munin_node_service = "munin" - $script_path = "/usr/libexec/munin/plugins" + $script_path_default = "/usr/libexec/munin/plugins" } } + $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path } + $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -29,7 +33,7 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path/${plugin_src}", + ensure => "$script_path_correct/${plugin_src}", require => Package[$munin_node_service], notify => Service[$munin_node_service], } |