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}'":
@ -159,6 +161,8 @@ define selinux::manage_fcontext($type, $recurse = true) {
} }
}
# Configure SELinux port authorizations # Configure SELinux port authorizations
# #
@ -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}":
@ -190,6 +196,8 @@ define selinux::manage_port($type, $proto) {
} }
}
# Install new SELinux module # Install new SELinux module
# #
@ -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": {
@ -251,6 +261,8 @@ define selinux::module($source) {
} }
}
# Prequisites for compiling SELinux modules # Prequisites for compiling SELinux modules
# #