try w/a needs-reboot check first
This commit is contained in:
parent
0794d1422a
commit
aef0304fff
1 changed files with 9 additions and 2 deletions
|
@ -5,12 +5,19 @@
|
|||
user: root
|
||||
|
||||
tasks:
|
||||
- name: see if it needs to be rebooted
|
||||
action: shell test -f /usr/local/bin/needs-reboot.py && /usr/local/bin/needs-reboot.py
|
||||
ignore_errors: True
|
||||
register: needsreboot
|
||||
|
||||
- name: reboot the host
|
||||
action: command /sbin/reboot
|
||||
action: command touch /tmp/would-reboot
|
||||
#/sbin/reboot
|
||||
only_if: '${needsreboot.stdout}.find("yes") != -1'
|
||||
|
||||
- name: wait for host to come back - up to 6 minutes
|
||||
local_action: wait_for host=${inventory_hostname} port=22 delay=10 timeout=420
|
||||
|
||||
only_if: '${needsreboot.stdout}.find("yes") != -1'
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue