summaryrefslogtreecommitdiff
path: root/manifests/plugin/deploy.pp
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/deploy.pp
parentea31faee76141646c173d88bd5bec5aa4a773c1c (diff)
parenta5ce0a9317fc5dd5228cff4c5b6d36366c17b6d5 (diff)
Merge branch 'master' into leap
Conflicts: README manifests/host/cgi.pp
Diffstat (limited to 'manifests/plugin/deploy.pp')
-rw-r--r--manifests/plugin/deploy.pp49
1 files changed, 27 insertions, 22 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
}
}