path als class inlcude
authoram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Fri, 1 Feb 2008 15:24:28 +0000 (15:24 +0000)
committeram <am@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Fri, 1 Feb 2008 15:24:28 +0000 (15:24 +0000)
git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@685 d66ca3ae-40d7-4aa7-90d4-87d79ca94279

manifests/plugin.pp

index d9b944c..572f79b 100644 (file)
@@ -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" ]: