add a host-reboot playbook that checks for the host returning
This commit is contained in:
parent
4d8891ce36
commit
dbbb92b72d
1 changed files with 16 additions and 0 deletions
16
playbooks/host-reboot.yml
Normal file
16
playbooks/host-reboot.yml
Normal 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
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue