summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authoram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2007-12-05 14:38:01 +0000
committeram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>2007-12-05 14:38:01 +0000
commit748e8d68a5f1624f9f41bfd870476fcf4e51d6dc (patch)
tree702f6b9a22476ae20da2e99ff646d0fdaa8a3ae1 /manifests
parent98ef8807b7ade3162c4ca2e14450641a29b1b4a1 (diff)
script path correction
git-svn-id: https://svn/ipuppet/trunk/modules/munin@204 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
Diffstat (limited to 'manifests')
-rw-r--r--manifests/plugin.pp12
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],
}