Hey ma. I think I broke my leg. Should this white thing be sticking out?
This commit is contained in:
parent
faa0561ffb
commit
f16181a2f3
1 changed files with 29 additions and 16 deletions
|
@ -1,32 +1,45 @@
|
||||||
# requires --extra-vars="target=hostspec"
|
# requires --extra-vars="target=hostspec"
|
||||||
|
|
||||||
- name: reboot hosts
|
- name: reboot hosts
|
||||||
hosts: $target
|
hosts: "{{ target }}"
|
||||||
|
gather_facts: False
|
||||||
user: root
|
user: root
|
||||||
serial: 1
|
serial: 1
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: see if it needs to be rebooted
|
|
||||||
action: command /usr/local/bin/needs-reboot.py
|
|
||||||
register: needsreboot
|
|
||||||
|
|
||||||
- name: tell nagios to shush
|
- name: tell nagios to shush
|
||||||
action: nagios action=silence host=${inventory_hostname_short}
|
nagios: action=downtime minutes=60 service=host host={{ inventory_hostname }}
|
||||||
delegate_to: noc01.phx2.fedoraproject.org
|
delegate_to: noc01.phx2.fedoraproject.org
|
||||||
when:"'yes' in needsreboot.stdout"
|
ignore_errors: true
|
||||||
|
|
||||||
- name: reboot the host
|
- name: reboot the virthost
|
||||||
action: command /sbin/reboot
|
command: /sbin/reboot
|
||||||
when:"'yes' in needsreboot.stdout"
|
|
||||||
|
|
||||||
- name: wait for host to come back - up to 6 minutes
|
- name: wait for host to come back - up to 6 minutes
|
||||||
local_action: wait_for host=${inventory_hostname} port=22 delay=30 timeout=420
|
local_action: wait_for host={{ target }} port=22 delay=120 timeout=420
|
||||||
when:"'yes' in needsreboot.stdout"
|
|
||||||
|
|
||||||
- name: tell nagios to unshush
|
|
||||||
action: nagios action=unsilence host=${inventory_hostname_short}
|
# - name: see if it needs to be rebooted
|
||||||
delegate_to: noc01.phx2.fedoraproject.org
|
# action: command /usr/local/bin/needs-reboot.py
|
||||||
when:"'yes' in needsreboot.stdout"
|
# 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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue