From fa3b0c563327deb29405eeacdf6ba7dd14d01869 Mon Sep 17 00:00:00 2001 From: am Date: Thu, 6 Dec 2007 10:07:42 +0000 Subject: haette ich schon lange an nen anderen ort tun sollen ... korrektur Service bei gentoo heisst munin-node git-svn-id: https://svn/ipuppet/trunk/modules/munin@209 d66ca3ae-40d7-4aa7-90d4-87d79ca94279 --- manifests/plugin.pp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/manifests/plugin.pp b/manifests/plugin.pp index de8f0a3..724e9a4 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -4,28 +4,30 @@ define munin::plugin ( $ensure = "present", - $script_path = '', + $script_path = $script_path_default, $config = '') { - #$script_path_default = "/usr/share/munin/plugins" case $operatingsystem { debian: { $munin_node_service = "munin-node" - $script_path_default = "/usr/share/munin/plugins" + $munin_node_package = "munin-node" + #$script_path_default = "/usr/share/munin/plugins" } gentoo: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } default: { - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" + $munin_node_service = "munin-node" + $munin_node_package = "munin" + #$script_path_default = "/usr/libexec/munin/plugins" } } - $script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } + #$script_path_correct = $script_path ? { '' => $script_path_default, default => $script_path_default } $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path_correct" ) + debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) $plugin = "/etc/munin/plugins/$name" $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" case $ensure { @@ -37,8 +39,8 @@ define munin::plugin ( #$plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: making $plugin using src: $plugin_src" ) file { $plugin: - ensure => "$script_path_correct/${plugin_src}", - require => Package[$munin_node_service], + ensure => "$script_path/${plugin_src}", + require => Package[$munin_node_package], notify => Service[$munin_node_service], } } @@ -87,8 +89,14 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { class munin::plugins::base { case $operatingsystem { - gentoo: { $munin_node_service = "munin" } - debian: { $munin_node_service = "munin-node" } + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin-node" + } + debian: { + $munin_node_service = "munin-node" + $munin_node_package = "munin-node" + } } file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: -- cgit v1.2.3