Execute calls on selinux
注解
This module requires the semanage, setsebool, and semodule
commands to be available on the minion. On RHEL-based distributions,
ensure that the policycoreutils and policycoreutils-python
packages are installed. If not on a Fedora or RHEL-based distribution,
consult the selinux documentation for your distribution to ensure that the
proper packages are installed.
salt.modules.selinux.getenforce()¶Return the mode selinux is running in
CLI 范例:
salt '*' selinux.getenforce
salt.modules.selinux.getsebool(boolean)¶Return the information on a specific selinux boolean
CLI 范例:
salt '*' selinux.getsebool virt_use_usb
salt.modules.selinux.getsemod(module)¶Return the information on a specific selinux module
CLI 范例:
salt '*' selinux.getsemod mysql
2016.3.0 新版功能.
salt.modules.selinux.list_sebool()¶Return a structure listing all of the selinux booleans on the system and what state they are in
CLI 范例:
salt '*' selinux.list_sebool
salt.modules.selinux.list_semod()¶Return a structure listing all of the selinux modules on the system and what state they are in
CLI 范例:
salt '*' selinux.list_semod
2016.3.0 新版功能.
salt.modules.selinux.selinux_fs_path(*args)¶Return the location of the SELinux VFS directory
CLI 范例:
salt '*' selinux.selinux_fs_path
salt.modules.selinux.setenforce(mode)¶Set the SELinux enforcing mode
CLI 范例:
salt '*' selinux.setenforce enforcing
salt.modules.selinux.setsebool(boolean, value, persist=False)¶Set the value for a boolean
CLI 范例:
salt '*' selinux.setsebool virt_use_usb off
salt.modules.selinux.setsebools(pairs, persist=False)¶Set the value of multiple booleans
CLI 范例:
salt '*' selinux.setsebools '{virt_use_usb: on, squid_use_tproxy: off}'
salt.modules.selinux.setsemod(module, state)¶Enable or disable an SELinux module.
CLI 范例:
salt '*' selinux.setsemod nagios Enabled
2016.3.0 新版功能.