diff options
Diffstat (limited to 'manifests/plugin')
-rw-r--r-- | manifests/plugin/deploy.pp | 16 | ||||
-rw-r--r-- | manifests/plugin/scriptpaths.pp | 14 |
2 files changed, 16 insertions, 14 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 + } } } diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp index 2cad97b..62dd77b 100644 --- a/manifests/plugin/scriptpaths.pp +++ b/manifests/plugin/scriptpaths.pp @@ -1,12 +1,10 @@ +# Determine the script path for each OS 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" } + gentoo: { $script_path = '/usr/libexec/munin/plugins' } + debian: { $script_path = '/usr/share/munin/plugins' } + centos: { $script_path = '/usr/share/munin/plugins' } + openbsd: { $script_path = '/usr/local/libexec/munin/plugins/' } + default: { $script_path = '/usr/share/munin/plugins' } } } |