mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-07-16 11:40:28 +08:00
Clean up host_reboot playbook.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user