Merge "Fix waiting OC VMs after restored from snapshot"
This commit is contained in:
commit
b623e952a7
|
@ -8,12 +8,21 @@
|
||||||
uri: "{{ libvirt_uri }}"
|
uri: "{{ libvirt_uri }}"
|
||||||
with_items: "{{ overcloud_nodes }}"
|
with_items: "{{ overcloud_nodes }}"
|
||||||
|
|
||||||
|
- name: Evaluate overcloud VM libvirt names
|
||||||
|
set_fact:
|
||||||
|
libvirt_oc_names: >-
|
||||||
|
{%- set names=[] -%}
|
||||||
|
{%- for n in overcloud_nodes -%}
|
||||||
|
{%- if names.append(hostvars[n['name']]['inventory_hostname']) -%}{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{{ names | join('|') }}
|
||||||
|
|
||||||
- name: Wait for vms to shutdown
|
- name: Wait for vms to shutdown
|
||||||
async: 300
|
async: 300
|
||||||
poll: 0
|
poll: 0
|
||||||
shell: |
|
shell: |
|
||||||
while true
|
while true
|
||||||
do virsh list | grep subnode > /dev/null || break
|
do virsh list | grep -E '{{ libvirt_oc_names }}' > /dev/null || break
|
||||||
done
|
done
|
||||||
register: vms_shutdown
|
register: vms_shutdown
|
||||||
|
|
||||||
|
@ -59,7 +68,7 @@
|
||||||
|
|
||||||
- name: "Wait for the vms to start"
|
- name: "Wait for the vms to start"
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ hostvars[item]['ansible_host'] }}"
|
host: "{{ hostvars[item.name]['ansible_host'] }}"
|
||||||
port: 22
|
port: 22
|
||||||
state: started
|
state: started
|
||||||
with_items: "{{ groups['subnodes'] }}"
|
with_items: "{{ overcloud_nodes }}"
|
||||||
|
|
Loading…
Reference in New Issue