Skip to content

Instantly share code, notes, and snippets.

@cfra
Created June 29, 2021 13:20
Show Gist options
  • Save cfra/c4190ad73d7966350344d3b308859f81 to your computer and use it in GitHub Desktop.
Save cfra/c4190ad73d7966350344d3b308859f81 to your computer and use it in GitHub Desktop.
Ansible: Use async task to work around unreachable Host while reloading networking configuration
---
- name: Reload networking (in-band)
service:
name: networking
state: reloaded
- name: Reload networking (out-of-band)
shell: ifreload --allow=mgmt
async: 45
poll: 0
- name: Wait for out-of-band network to start reload
pause:
seconds: 2
- name: Wait for out-of-band network to finish reload
wait_for_connection:
timeout: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment