add a host-reboot playbook that checks for the host returning

This commit is contained in:
Seth Vidal 2012-12-11 21:59:32 +00:00
parent 4d8891ce36
commit dbbb92b72d

16
playbooks/host-reboot.yml Normal file
View file

@ -0,0 +1,16 @@
# requires --extra-vars="hosts=hostspec"
- name: reboot hosts
hosts: $hosts
user: root
tasks:
- name: halt -r the host
action: command /sbin/halt -r
- name: wait for $host to come back - up to 6 minutes
local_action: wait_for host=${inventory_hostname} port=22 delay=10 timeout=420