Skip to content

Commit 36deefa

Browse files
authored
common: reboot to change selinux state (#48)
1 parent 677a44b commit 36deefa

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

ansible/bootstrap.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@
1111
- hosts: selinux
1212
gather_facts: false
1313
become: yes
14+
tags:
15+
- selinux
1416
tasks:
15-
- ansible.posix.selinux:
17+
- name: Set SELinux state and policy
18+
ansible.posix.selinux:
1619
state: "{{ selinux_state }}"
1720
policy: "{{ selinux_policy }}"
21+
register: sestatus
22+
- name: Reboot if required to change SELinux state
23+
reboot:
24+
when: sestatus.reboot_required
25+
- name: Wait for hosts to be reachable
26+
wait_for_connection:
27+
delay: 30
28+
sleep: 5
29+
when: sestatus.reboot_required

0 commit comments

Comments
 (0)