summaryrefslogtreecommitdiff
path: root/manifests/plugin/deploy.pp
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-01-20 18:40:04 +0000
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-01-20 18:40:04 +0000
commit23201220bf8b7b63da44747be142face0c98eb09 (patch)
treec1645f62976281a552963b1309307e0d0b6136f3 /manifests/plugin/deploy.pp
parent7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff)
parenteaa092eb1a8f3ae19551e6e80f84d174211b5208 (diff)
Merge branch 'merge_immerda' into 'master'
This is my attempt at merging the huge backlog of commits from immerda. I've been pretty verbose about it in redmine so I won't repeat it all here. For details, see: https://labs.riseup.net/code/issues/4132
Diffstat (limited to 'manifests/plugin/deploy.pp')
-rw-r--r--manifests/plugin/deploy.pp16
1 files changed, 10 insertions, 6 deletions
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index cbf64fb..2ffd92e 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -3,7 +3,8 @@ define munin::plugin::deploy(
$ensure = 'present',
$source = '',
$config = '',
- $seltype = 'munin_exec_t'
+ $seltype = 'munin_unconfined_plugin_exec_t',
+ $register = true,
) {
$plugin_src = $ensure ? {
'present' => $name,
@@ -23,7 +24,7 @@ define munin::plugin::deploy(
mode => '0755';
}
- if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+ if (str2bool($::selinux) == true) and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::operatingsystemmajrelease > '5')){
File["munin_plugin_${name}"]{
seltype => $seltype,
}
@@ -36,9 +37,12 @@ define munin::plugin::deploy(
File["munin_plugin_${name}"]{
require => $basic_require,
}
- # register the plugin
- munin::plugin{$name:
- ensure => $ensure,
- config => $config
+
+ # register the plugin if required
+ if ($register) {
+ munin::plugin{$name:
+ ensure => $ensure,
+ config => $config
+ }
}
}