Added check if selinux is enabled into selinux::* defines.

This commit is contained in:
Timo Mkinen 2012-06-08 21:21:45 +03:00
parent 3888a337f8
commit 347ce1c2c2

View file

@ -136,6 +136,8 @@ define selinux::boolean($value) {
# #
define selinux::manage_fcontext($type, $recurse = true) { define selinux::manage_fcontext($type, $recurse = true) {
if "${selinux}" == "true" {
include selinux::tools include selinux::tools
exec { "semanage fcontext -a -t '${type}' '${name}'": exec { "semanage fcontext -a -t '${type}' '${name}'":
@ -157,6 +159,8 @@ define selinux::manage_fcontext($type, $recurse = true) {
refreshonly => true, refreshonly => true,
} }
}
} }
@ -180,6 +184,8 @@ define selinux::manage_fcontext($type, $recurse = true) {
# #
define selinux::manage_port($type, $proto) { define selinux::manage_port($type, $proto) {
if "${selinux}" == "true" {
include selinux::tools include selinux::tools
exec { "semanage port -a -t ${type} -p ${proto} ${name}": exec { "semanage port -a -t ${type} -p ${proto} ${name}":
@ -188,6 +194,8 @@ define selinux::manage_port($type, $proto) {
require => Class["selinux::tools"], require => Class["selinux::tools"],
} }
}
} }
@ -208,6 +216,8 @@ define selinux::manage_port($type, $proto) {
# #
define selinux::module($source) { define selinux::module($source) {
if "${selinux}" == "true" {
$ext = regsubst($source, '.*\.(te|pp)', '\1') $ext = regsubst($source, '.*\.(te|pp)', '\1')
case $ext { case $ext {
"te": { "te": {
@ -249,6 +259,8 @@ define selinux::module($source) {
syncversion => true, syncversion => true,
} }
}
} }