Skip to content

Instantly share code, notes, and snippets.

@AntelopeSalad
Created June 17, 2014 22:34
Show Gist options
  • Save AntelopeSalad/87f5b375bcb2887e095e to your computer and use it in GitHub Desktop.
Save AntelopeSalad/87f5b375bcb2887e095e to your computer and use it in GitHub Desktop.
- name: Reboot a host and wait for it to return
hosts: somehost
tasks:
- shell: shutdown -r now
- pause: seconds=30
- local_action: shell ansible -m ping {{ inventory_hostname }}
register: result
until: result.rc == 0
retries: 30
delay: 10
- shell: uptime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment