manage selinux if enabled of plugins we manage
authormh <mh@immerda.ch>
Wed, 15 Feb 2012 17:17:14 +0000 (18:17 +0100)
committermh <mh@immerda.ch>
Wed, 15 Feb 2012 17:17:14 +0000 (18:17 +0100)
manifests/plugin.pp
manifests/plugin/deploy.pp

index 69b7322..b76a5da 100644 (file)
@@ -21,7 +21,7 @@ define munin::plugin (
             file { $plugin: ensure => absent, }
         }
         default: {
-            case $kernel {
+            case $::kernel {
                 openbsd: { $basic_require = File['/var/run/munin'] }
                 default: { $basic_require = Package['munin-node'] }
             }
@@ -35,7 +35,11 @@ define munin::plugin (
                 require => $real_require,
                 notify => Service['munin-node'];
             }
-
+            if $::selinux == 'true' {
+              File[$plugin]{
+                setype => 'munin_services_plugin_exec_t',
+              }
+            }
         }
     }
     case $config {
index 67cbfb8..be7748b 100644 (file)
@@ -15,7 +15,14 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') {
             mode => 0755, owner => root, group => 0;
     }
 
-    case $kernel {
+
+    if $::selinux == 'true' {
+      File["munin_plugin_${name}"]{
+        setype =>  'munin_services_plugin_exec_t',
+      }
+    }
+
+    case $::kernel {
         openbsd: { $basic_require = File['/var/run/munin'] }
         default: { $basic_require = Package['munin-node'] }
     }