Updated to force a reboot if selinux is enabled.
diff --git a/handlers/main.yml b/handlers/main.yml index 2701da2..28abd0a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml
@@ -1,9 +1,2 @@ --- # handlers file for opdk-setup-selinux-disable - -- name: restart node - become: true - ignore_errors: yes - shell: 'reboot now' - async: '{{ restart_node_async }}' - poll: '{{ restart_node_poll }}'
diff --git a/tasks/main.yml b/tasks/main.yml index f995601..f33a969 100644 --- a/tasks/main.yml +++ b/tasks/main.yml
@@ -9,18 +9,21 @@ backup: yes when: "{{ ansible_selinux.status | lower != 'disabled' }}" +- name: Refresh setup facts + setup: + - name: Restart playbook if selinux is running debug: msg: 'SELinux MUST be disabled, selinux has been updated, restarting node now...' when: "{{ ansible_selinux.status | lower != 'disabled' }}" + notify: + - 'restart node' -- name: Restart node +- name: Restarting node now + become: true + ignore_errors: yes shell: 'reboot now' when: "{{ ansible_selinux.status | lower != 'disabled' }}" - -# -# notify: -# - restart node -# -#- meta: flush_handlers + async: 45 + poll: 0