* added centos to the munin module
authorandreas <andreas@immerda.ch>
Fri, 7 Dec 2007 11:07:31 +0000 (11:07 +0000)
committerandreas <andreas@immerda.ch>
Fri, 7 Dec 2007 11:07:31 +0000 (11:07 +0000)
* little corrections in shorewall-local stuff

manifests/client.pp
manifests/plugin.pp

index 639d133..18a4043 100644 (file)
@@ -25,7 +25,10 @@ class munin::client {
                gentoo: {
                        include munin::client::gentoo
                        include munin::plugins::gentoo
-       
+               }
+               centos: {
+                       include munin::client::centos
+                       include munin::plugins::centos
                }
                default: { fail ("Don't know how to handle munin on $operatingsystem") }
        }
@@ -157,3 +160,35 @@ class munin::client::gentoo
 
 }
 
+class munin::client::centos 
+{
+        package { 'munin-node':
+                ensure => present,
+                category => $operatingsystem ? {
+                        gentoo => 'net-analyzer',
+                        default => '',
+                },
+        }
+
+
+       file {
+               "/etc/munin/":
+                       ensure => directory,
+                       mode => 0755, owner => root, group => root;
+               "/etc/munin/munin-node.conf":
+                       content => template("munin/munin-node.conf.CentOS."),
+                       mode => 0644, owner => root, group => root,
+                       # this has to be installed before the package, so the postinst can
+                       # boot the munin-node without failure!
+                       before => Package["munin"],
+                       notify => Service["munin"],
+       }
+
+       service { "munin":
+               ensure => running, 
+       }
+
+       munin::register { $fqdn: }
+
+}
+
index 2ae20d2..579e2f9 100644 (file)
@@ -11,21 +11,21 @@ define munin::plugin (
                debian: {       
                        $munin_node_service = "munin-node" 
                        $munin_node_package = "munin-node" 
-                       #$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_default = "/usr/libexec/munin/plugins"
                }
                default: {
-                       $munin_node_service = "munin"
-                       $munin_node_package = "munin" 
-                       #$script_path_default = "/usr/libexec/munin/plugins"
+                       $munin_node_service = "munin-node"
+                       $munin_node_package = "munin-node" 
                }
        }
-       #$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" )
@@ -37,7 +37,6 @@ define munin::plugin (
                        file { $plugin: ensure => absent, } 
                }
                default: {
-                       #$plugin_src = $ensure ? { "present" => $name, default => $ensure }
                        debug ( "munin_plugin: making $plugin using src: $plugin_src" )
                        file { $plugin:
                                ensure => "$script_path/${plugin_src}",
@@ -98,6 +97,14 @@ class munin::plugins::base {
                        $munin_node_service = "munin-node" 
                        $munin_node_package = "munin-node" 
                        }
+               centos: {               
+                       $munin_node_service = "munin-node" 
+                       $munin_node_package = "munin-node" 
+                       }
+               default: {
+                       $munin_node_service = "munin-node"
+                       $munin_node_package = "munin-node" 
+               }
        }
                file {
                        [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
@@ -155,5 +162,8 @@ class munin::plugins::vserver inherits munin::plugins::base {
 }
 
 class munin::plugins::gentoo inherits munin::plugins::base {
+}
 
+class munin::plugins::centos inherits munin::plugins::base {
 }
+