salt.states.selinux

Management of SELinux rules

If SELinux is available for the running system, the mode can be managed and booleans can be set.

enforcing:
    selinux.mode

samba_create_home_dirs:
    selinux.boolean:
      - value: True
      - persist: True

nginx:
    selinux.module:
      - enabled: False

注解

Use of these states require that the selinux execution module is available.

salt.states.selinux.boolean(name, value, persist=False)

Set up an SELinux boolean

name
The name of the boolean to set
value
The value to set on the boolean
persist
Defaults to False, set persist to true to make the boolean apply on a reboot
salt.states.selinux.mode(name)

Verifies the mode SELinux is running in, can be set to enforcing, permissive, or disabled

Note: A change to or from disabled mode requires a system reboot.
You will need to perform this yourself.
name
The mode to run SELinux in, permissive, enforcing, or disabled.
salt.states.selinux.module(name, module_state='Enabled', version='any')

Enable/Disable and optionally force a specific version for an SELinux module

name
The name of the module to control
module_state
Should the module be enabled or disabled?
version
Defaults to no preference, set to a specified value if required. Currently can only alert if the version is incorrect.

2016.3.0 新版功能.