try out vhost-reboot with nagios cancelling of guests and vhost
This commit is contained in:
parent
482ffc1b39
commit
73bb8e20d4
1 changed files with 20 additions and 2 deletions
|
@ -36,27 +36,45 @@
|
|||
- name: halt instances
|
||||
hosts: myvms_new
|
||||
user: root
|
||||
serial: 1
|
||||
|
||||
tasks:
|
||||
- name: tell nagios to shush
|
||||
action: nagios action=silence host=${inventory_hostname_short}
|
||||
delegate_to: noc01.phx2.fedoraproject.org
|
||||
|
||||
- name: echo-y
|
||||
action: command echo "I would run halt -p"
|
||||
action: command /sbin/halt -p
|
||||
ignore_errors: true
|
||||
# if one of them is down we don't care
|
||||
|
||||
- name: wait for them to die
|
||||
local_action: wait_for port=22 delay=30 timeout=300 state=stopped host=${inventory_hostname}
|
||||
|
||||
- name: tell nagios to unshush
|
||||
action: nagios action=unsilence host=${inventory_hostname_short}
|
||||
delegate_to: noc01.phx2.fedoraproject.org
|
||||
|
||||
|
||||
- name: reboot vhost
|
||||
hosts: $vhost
|
||||
user: root
|
||||
|
||||
tasks:
|
||||
- name: tell nagios to shush
|
||||
action: nagios action=silence host=${inventory_hostname_short}
|
||||
delegate_to: noc01.phx2.fedoraproject.org
|
||||
|
||||
- name: halt -r the $vhost
|
||||
action: command echo 'I would run halt -r'
|
||||
action: command /sbin/reboot
|
||||
|
||||
- name: wait for $vhost to come back - up to 6 minutes
|
||||
local_action: wait_for host=$vhost port=22 delay=120 timeout=420
|
||||
|
||||
- name: tell nagios to unshush
|
||||
action: nagios action=unsilence host=${inventory_hostname_short}
|
||||
delegate_to: noc01.phx2.fedoraproject.org
|
||||
|
||||
- name: look up vmlist
|
||||
action: virt command=list_vms
|
||||
register: newvmlist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue