From 0ed246de50b9da2a1623e278fd581a378e1fc0e0 Mon Sep 17 00:00:00 2001 From: andreas Date: Fri, 1 Feb 2008 15:24:28 +0000 Subject: path als class inlcude --- manifests/plugin.pp | 59 +++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) (limited to 'manifests') diff --git a/manifests/plugin.pp b/manifests/plugin.pp index d9b944c..572f79b 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -2,31 +2,39 @@ # Copyright (C) 2007 David Schmitt # See LICENSE for the full license granted to you. -define munin::plugin ( - $ensure = "present", - $script_path = '/usr/libexec/munin/plugins', - $config = '') +class munin::plugin::paths { case $operatingsystem { - debian: { + gentoo: { + $munin_node_package = "munin" + $munin_node_service = "munin" + $script_path_default = "/usr/libexec/munin/plugins" + } + debian: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - centos: { + $script_path_default = "/usr/share/munin/plugins" + } + centos: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" - } - gentoo: { - #$munin_node_service = "munin-node" - $munin_node_service = "munin" - $munin_node_package = "munin" - $script_path = $script_path_default, - } + $script_path_default = "/usr/share/munin/plugins" + } default: { $munin_node_service = "munin-node" $munin_node_package = "munin-node" + $script_path_default = "/usr/share/munin/plugins" } } + +{ + +define munin::plugin ( + $ensure = "present", + $script_path = '/usr/libexec/munin/plugins', + $config = '') +{ + include munin::plugin::paths $plugin_src = $ensure ? { "present" => $name, default => $ensure } debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) @@ -98,29 +106,8 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { } class munin::plugins::base { + include munin::plugin::paths - case $operatingsystem { - gentoo: { - $munin_node_package = "munin" - $munin_node_service = "munin" - $script_path_default = "/usr/libexec/munin/plugins" - } - debian: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - centos: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - default: { - $munin_node_service = "munin-node" - $munin_node_package = "munin-node" - $script_path_default = "/usr/libexec/munin/plugins" - } - } case $operatingsystem { centos: { file { -- cgit v1.2.3