add become to hanlder

This commit is contained in:
Robert Kaussow 2018-07-07 19:37:56 +02:00
parent 44263bce25
commit b16a0ce3e3

View File

@ -1,21 +1,23 @@
--- ---
- name: Restart network - block:
shell: sleep 2 && systemctl restart network - name: Restart network
async: 1 shell: sleep 2 && systemctl restart network
poll: 0 async: 1
ignore_errors: true poll: 0
when: not require_reboot ignore_errors: true
listen: when: not require_reboot
- "network_restart" listen:
- "network_restart"
- name: Reboot server - name: Reboot server
shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible" shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible"
async: 1 async: 1
poll: 0 poll: 0
ignore_errors: true ignore_errors: true
when: require_reboot when: require_reboot
listen: listen:
- "host_reboot" - "host_reboot"
become: True
- name: Waiting for host startup - name: Waiting for host startup
wait_for_connection: wait_for_connection: