summaryrefslogtreecommitdiff
path: root/manifests/plugin
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-04-17 16:36:37 -0400
committerMicah Anderson <micah@riseup.net>2013-04-17 16:36:37 -0400
commit8f7c0071eb82591477876eeb3f309067853a3261 (patch)
treeb095f01b960b7ba3699da2dfa4d84cd5bb8a6361 /manifests/plugin
parentea31faee76141646c173d88bd5bec5aa4a773c1c (diff)
parenta5ce0a9317fc5dd5228cff4c5b6d36366c17b6d5 (diff)
Merge branch 'master' into leap
Conflicts: README manifests/host/cgi.pp
Diffstat (limited to 'manifests/plugin')
-rw-r--r--manifests/plugin/deploy.pp49
-rw-r--r--manifests/plugin/scriptpaths.pp20
2 files changed, 37 insertions, 32 deletions
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index 0ab4e9f..cbf64fb 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -1,39 +1,44 @@
-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://$server/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';
}
- case $kernel {
- openbsd: { $basic_require = File['/var/run/munin'] }
- default: { $basic_require = Package['munin-node'] }
- }
-
- if $require { File["munin_plugin_${name}"]{ require => [ $basic_require, $require ] } }
- else {
+ if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
File["munin_plugin_${name}"]{
- require => $basic_require,
+ seltype => $seltype,
}
}
+ case $::kernel {
+ openbsd: { $basic_require = File['/var/run/munin'] }
+ default: { $basic_require = Package['munin-node'] }
+ }
+ 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/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp
index 164a17e..2cad97b 100644
--- a/manifests/plugin/scriptpaths.pp
+++ b/manifests/plugin/scriptpaths.pp
@@ -1,12 +1,12 @@
class munin::plugin::scriptpaths {
- case $operatingsystem {
- gentoo: { $script_path = "/usr/libexec/munin/plugins" }
- debian: { $script_path = "/usr/share/munin/plugins" }
- centos: { $script_path = "/usr/share/munin/plugins" }
- openbsd: { $script_path = $operatingsystemrelease ? {
- '4.3' => '/opt/munin/lib/plugins/',
- default => '/usr/local/libexec/munin/plugins/'
- } }
- default: { $script_path = "/usr/share/munin/plugins" }
- }
+ case $::operatingsystem {
+ gentoo: { $script_path = "/usr/libexec/munin/plugins" }
+ debian: { $script_path = "/usr/share/munin/plugins" }
+ centos: { $script_path = "/usr/share/munin/plugins" }
+ openbsd: { $script_path = $::operatingsystemrelease ? {
+ '4.3' => '/opt/munin/lib/plugins/',
+ default => '/usr/local/libexec/munin/plugins/'
+ } }
+ default: { $script_path = "/usr/share/munin/plugins" }
+ }
}