Added check if selinux is enabled into selinux::* defines.
This commit is contained in:
parent
3888a337f8
commit
347ce1c2c2
1 changed files with 68 additions and 56 deletions
|
@ -136,6 +136,8 @@ define selinux::boolean($value) {
|
|||
#
|
||||
define selinux::manage_fcontext($type, $recurse = true) {
|
||||
|
||||
if "${selinux}" == "true" {
|
||||
|
||||
include selinux::tools
|
||||
|
||||
exec { "semanage fcontext -a -t '${type}' '${name}'":
|
||||
|
@ -159,6 +161,8 @@ define selinux::manage_fcontext($type, $recurse = true) {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Configure SELinux port authorizations
|
||||
#
|
||||
|
@ -180,6 +184,8 @@ define selinux::manage_fcontext($type, $recurse = true) {
|
|||
#
|
||||
define selinux::manage_port($type, $proto) {
|
||||
|
||||
if "${selinux}" == "true" {
|
||||
|
||||
include selinux::tools
|
||||
|
||||
exec { "semanage port -a -t ${type} -p ${proto} ${name}":
|
||||
|
@ -190,6 +196,8 @@ define selinux::manage_port($type, $proto) {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install new SELinux module
|
||||
#
|
||||
|
@ -208,6 +216,8 @@ define selinux::manage_port($type, $proto) {
|
|||
#
|
||||
define selinux::module($source) {
|
||||
|
||||
if "${selinux}" == "true" {
|
||||
|
||||
$ext = regsubst($source, '.*\.(te|pp)', '\1')
|
||||
case $ext {
|
||||
"te": {
|
||||
|
@ -251,6 +261,8 @@ define selinux::module($source) {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Prequisites for compiling SELinux modules
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue