Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
# complexity = low
# disruption = low

- name: "{{{ rule_title }}} - Check current SELinux state"
ansible.builtin.command:
cmd: getenforce
register: selinux_state
check_mode: false
changed_when: false

{{{ ansible_selinux_config_set(parameter="SELINUX", value="permissive", rule_title=rule_title) }}}

- name: "{{{ RULE_TITLE }}} - Mark system to relabel SELinux on next boot"
- name: "{{{ rule_title }}} - Mark system to relabel SELinux on next boot"
ansible.builtin.file:
path: /.autorelabel
state: touch
access_time: preserve
modification_time: preserve
when: selinux_state.stdout | lower != "permissive"
12 changes: 11 additions & 1 deletion linux_os/guide/system/selinux/selinux_state/ansible/shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,19 @@
# disruption = low
{{{ ansible_instantiate_variables("var_selinux_state") }}}

- name: "{{{ rule_title }}} - Check current SELinux state"
ansible.builtin.command:
cmd: getenforce
register: selinux_state
check_mode: false
changed_when: false

{{{ ansible_selinux_config_set(parameter="SELINUX", value="{{ var_selinux_state }}", rule_title=rule_title) }}}

- name: "{{{ RULE_TITLE }}} - Mark system to relabel SELinux on next boot"
- name: "{{{ rule_title }}} - Mark system to relabel SELinux on next boot"
ansible.builtin.file:
path: /.autorelabel
state: touch
access_time: preserve
modification_time: preserve
when: selinux_state.stdout | lower != var_selinux_state
Loading