From dbbb92b72ded76ff95e9fa84199d80e232e293af Mon Sep 17 00:00:00 2001 From: Seth Vidal Date: Tue, 11 Dec 2012 21:59:32 +0000 Subject: [PATCH] add a host-reboot playbook that checks for the host returning --- playbooks/host-reboot.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 playbooks/host-reboot.yml diff --git a/playbooks/host-reboot.yml b/playbooks/host-reboot.yml new file mode 100644 index 0000000000..7cece84ca3 --- /dev/null +++ b/playbooks/host-reboot.yml @@ -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 + + + +