diff options
author | andreas <andreas@immerda.ch> | 2008-02-01 15:24:28 +0000 |
---|---|---|
committer | andreas <andreas@immerda.ch> | 2008-02-01 15:24:28 +0000 |
commit | 0ed246de50b9da2a1623e278fd581a378e1fc0e0 (patch) | |
tree | d8e48d1097ff8902c3cbdb99ad6fad26f892efa3 /manifests | |
parent | e644c426af63a4c490192ff567108f4aa8d3d628 (diff) |
path als class inlcude
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/plugin.pp | 59 |
1 files changed, 23 insertions, 36 deletions
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 <david@schmitt.edv-bus.at> # 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,30 +106,9 @@ 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 { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: |