summaryrefslogtreecommitdiff
path: root/manifests/plugin.pp
diff options
context:
space:
mode:
authorandreas <andreas@immerda.ch>2007-12-05 14:38:01 +0000
committerandreas <andreas@immerda.ch>2007-12-05 14:38:01 +0000
commit4d6bc8018c0edb91964ecd6f7fd1bfc713f9a646 (patch)
tree702f6b9a22476ae20da2e99ff646d0fdaa8a3ae1 /manifests/plugin.pp
parente6d50c7d3eb1795ae1e285985f0799549095d520 (diff)
script path correction
Diffstat (limited to 'manifests/plugin.pp')
-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],
}