diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/plugin/deploy.pp | 41 | ||||
-rw-r--r-- | manifests/plugins/apache.pp | 4 |
2 files changed, 21 insertions, 24 deletions
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 9e74afb..cbf64fb 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,23 +1,31 @@ -define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { +# deploy and register a munin plugin +define munin::plugin::deploy( + $ensure = 'present', + $source = '', + $config = '', + $seltype = 'munin_exec_t' +) { $plugin_src = $ensure ? { 'present' => $name, - 'absent' => $name, - default => $ensure + 'absent' => $name, + default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$plugin_src", + '' => "munin/plugins/${plugin_src}", default => $source } include munin::plugin::scriptpaths file { "munin_plugin_${name}": - path => "${munin::plugin::scriptpaths::script_path}/${name}", - source => "puppet:///modules/${real_source}", - mode => 0755, owner => root, group => 0; + path => "${munin::plugin::scriptpaths::script_path}/${name}", + source => "puppet:///modules/${real_source}", + owner => root, + group => 0, + mode => '0755'; } if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){ File["munin_plugin_${name}"]{ - seltype => 'munin_exec_t', + seltype => $seltype, } } @@ -25,19 +33,12 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { openbsd: { $basic_require = File['/var/run/munin'] } default: { $basic_require = Package['munin-node'] } } - if $require { - File["munin_plugin_${name}"]{ - require => [ $basic_require, $require ], - } - } else { - File["munin_plugin_${name}"]{ - require => $basic_require, - } + File["munin_plugin_${name}"]{ + require => $basic_require, } # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } + munin::plugin{$name: + ensure => $ensure, + config => $config } } diff --git a/manifests/plugins/apache.pp b/manifests/plugins/apache.pp deleted file mode 100644 index dca3cea..0000000 --- a/manifests/plugins/apache.pp +++ /dev/null @@ -1,4 +0,0 @@ -class munin::plugins::apache { - munin::plugin{ [ 'apache_accesses', 'apache_processes', 'apache_volume' ]: } - munin::plugin::deploy { 'apache_activity': } -} |