merged with davids and removed a case statement, which made no sense
authormh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Tue, 8 Jul 2008 18:41:55 +0000 (18:41 +0000)
committermh <mh@d66ca3ae-40d7-4aa7-90d4-87d79ca94279>
Tue, 8 Jul 2008 18:41:55 +0000 (18:41 +0000)
git-svn-id: https://rfd.cronopios.org/ipuppet/trunk/modules/munin@1778 d66ca3ae-40d7-4aa7-90d4-87d79ca94279

1  2 
manifests/plugin.pp

@@@ -103,82 -65,24 +103,65 @@@ define munin::remoteplugin($ensure = "p
                }
        }
  }
 +define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') {
 +    $plugin_src = $ensure ? { 
 +        'present' => $name, 
 +        'absent' => $name, 
 +        default => $ensure 
 +    }
 +    $real_source = $source ? {
 +        ''  =>  "munin/plugins/$plugin_src",
 +        default => $source
 +    }
 +    include munin::plugin::scriptpaths
 +      debug ( "munin_plugin_${name}: name=$name, source=$source, script_path=$munin::plugin::scriptpaths::script_path" )
 +    file { "munin_plugin_${name}":
 +            path => "$munin::plugin::scriptpaths::script_path/${name}",
 +            source => "puppet://$server/$real_source",
 +                      require => Package['munin-node'],
 +            mode => 0755, owner => root, group => 0;
 +    }
 +    if $require {
 +        File["munin_plugin_${name}"]{
 +            require +> $require,
 +        }
 +        munin::plugin{$name: ensure => $ensure, config => $config, require => $require }
 +    } else {
 +        munin::plugin{$name: ensure => $ensure, config => $config }
 +    }
 +}
  
 -class munin::plugins::base {
 +### clases for plugins
  
 -      file {
 -              [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
 -                      source => "puppet://$servername/common/empty",
 +class munin::plugins::base {
-       case $operatingsystem {
-               centos: {               
-                   file {
-                       [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
-                               source => "puppet://$server/munin/empty",
-                               ensure => directory, checksum => mtime,
-                               recurse => true, purge => true, force => true, 
-                               mode => 0755, owner => root, group => 0;
-                       "/etc/munin/plugin-conf.d/munin-node":
-                               ensure => present, 
-                               mode => 0644, owner => root, group => 0;
-                   }
-               }
-               default: {
-                   file {
-                       [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
-                               source => "puppet://$server/munin/empty",
-                               ensure => directory, checksum => mtime,
-                               recurse => true, purge => true, force => true, 
-                               mode => 0755, owner => root, group => 0,
-                               notify => Service['munin-node'];
-                       "/etc/munin/plugin-conf.d/munin-node":
-                               ensure => present, 
-                               mode => 0644, owner => root, group => 0,
-                               notify => Service['munin-node'],
-                 before => Package['munin-node'];
-                   }
-               }
++    file {
++          [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
++              source => "puppet://$server/common/empty",
+                       ensure => directory, checksum => mtime,
 -                      ignore => '.ignore',
+                       recurse => true, purge => true, force => true, 
 -                      mode => 0755, owner => root, group => root,
 -                      notify => Service[munin-node];
++                      mode => 0755, owner => root, group => 0,
++                      notify => Service['munin-node'];
+               "/etc/munin/plugin-conf.d/munin-node":
+                       ensure => present, 
 -                      mode => 0644, owner => root, group => root,
 -                      notify => Service[munin-node],
 -                      before => Package[munin-node];
++                      mode => 0644, owner => root, group => 0,
++                      notify => Service['munin-node'],
++            before => Package['munin-node'];
        }
 -
 +    case $kernel {
 +        linux: {
 +            case $vserver {
 +                guest: { include munin::plugins::vserver }
 +                default: {
 +                    include munin::plugins::linux
 +                }
 +            }
 +        }
 +    }
 +    case $virtual {
 +        physical: { include munin::plugins::physical }
 +        xen0: { include munin::plugins::dom0 }
 +        xenu: { include munin::plugins::domU }
 +    }
  }
  
  # handle if_ and if_err_ plugins