From 123621013947efcc7e078bf4dbce0baf3473df88 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 30 Sep 2014 16:48:50 +0000 Subject: [PATCH] Clean up host_reboot playbook. --- playbooks/host_reboot.yml | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/playbooks/host_reboot.yml b/playbooks/host_reboot.yml index cb55d45bc3..a974b4155c 100644 --- a/playbooks/host_reboot.yml +++ b/playbooks/host_reboot.yml @@ -12,34 +12,16 @@ delegate_to: noc01.phx2.fedoraproject.org ignore_errors: true - - name: reboot the virthost - command: /sbin/reboot - - - name: wait for host to come back - up to 6 minutes - local_action: wait_for host={{ target }} port=22 delay=120 timeout=420 - - - # - name: see if it needs to be rebooted - # action: command /usr/local/bin/needs-reboot.py - # register: needsreboot - - # - name: tell nagios to shush - # action: nagios action=silence host=${inventory_hostname_short} - # delegate_to: noc01.phx2.fedoraproject.org - # when:"'yes' in needsreboot.stdout" - - # - name: reboot the host - # action: command /sbin/reboot - # when:"'yes' in needsreboot.stdout" - - # - name: wait for host to come back - up to 6 minutes - # local_action: wait_for host=${inventory_hostname} port=22 delay=30 timeout=420 - # when:"'yes' in needsreboot.stdout" - - # - name: tell nagios to unshush - # action: nagios action=unsilence host=${inventory_hostname_short} - # delegate_to: noc01.phx2.fedoraproject.org - # when:"'yes' in needsreboot.stdout" + - name: reboot the host + command: /sbin/shutdown -r 1 + - name: wait for host to come back - up to 15 minutes + local_action: wait_for host={{ target }} port=22 delay=120 timeout=900 search_regex=OpenSSH + - name: sync time + command: ntpdate -u 66.187.233.4 + - name: tell nagios to unshush + nagios: action=unsilence service=host host={{ inventory_hostname }} + delegate_to: noc01.phx2.fedoraproject.org + ignore_errors: true