diff --git a/handlers/main.yml b/handlers/main.yml index 7fa54d2..4df4bac 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -6,9 +6,12 @@ poll: 0 when: not require_reboot | bool listen: __network_restart + tags: + - skip_ansible_later - name: Reboot server - shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible" + reboot: + msg: "Reboot triggered by Ansible" async: 1 poll: 0 ignore_errors: yes diff --git a/vars/default.yml b/vars/default.yml index cd9eb38..bb84a2f 100644 --- a/vars/default.yml +++ b/vars/default.yml @@ -1,2 +1,2 @@ --- -__network_restart_command: sleep 2 && systemctl restart network +__network_restart_command: systemctl restart network diff --git a/vars/redhat-9.yml b/vars/redhat-9.yml index d41c09f..ef597dc 100644 --- a/vars/redhat-9.yml +++ b/vars/redhat-9.yml @@ -1,6 +1,6 @@ --- __network_restart_command: |- - nmcli connection reload && + nmcli connection reload {%- for file in __network_ifcfg | json_query('results[?changed==`true`].dest') %} - nmcli conn up {{ file }} + && nmcli conn up {{ file }} {%- endfor %}