mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
respawn selinux module when selinux is missing
This commit is contained in:
parent
63fba50912
commit
34a9cf3e4d
2 changed files with 6 additions and 0 deletions
|
|
@ -2,3 +2,5 @@
|
|||
minor_changes:
|
||||
- "seboolean - respawn module to use the system python interpreter when the ``selinux`` python module is not available for ``ansible_python_interpreter``
|
||||
(https://github.com/ansible-collections/ansible.posix/pull/460)."
|
||||
- "selinux - respawn module to use the system python interpreter when the ``selinux`` python module is not available for ``ansible_python_interpreter``
|
||||
(https://github.com/ansible-collections/ansible.posix/pull/460)."
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
|||
from ansible.module_utils.common.process import get_bin_path
|
||||
from ansible.module_utils.facts.utils import get_file_lines
|
||||
|
||||
from ansible_collections.ansible.posix.plugins.module_utils._respawn import respawn_module, HAS_RESPAWN_UTIL
|
||||
|
||||
|
||||
# getter subroutines
|
||||
def get_config_state(configfile):
|
||||
|
|
@ -236,6 +238,8 @@ def main():
|
|||
)
|
||||
|
||||
if not HAS_SELINUX:
|
||||
if HAS_RESPAWN_UTIL:
|
||||
respawn_module("selinux")
|
||||
module.fail_json(msg=missing_required_lib('libselinux-python'), exception=SELINUX_IMP_ERR)
|
||||
|
||||
# global vars
|
||||
|
|
|
|||
Loading…
Reference in a new issue