Lets see if this is a bit cleaner and more ansibley
This commit is contained in:
parent
ece93a1936
commit
84212e5e66
1 changed files with 6 additions and 5 deletions
|
@ -18,12 +18,13 @@
|
||||||
delegate_to: "{{ vmhost }}"
|
delegate_to: "{{ vmhost }}"
|
||||||
when: inventory_hostname not in result.list_vms
|
when: inventory_hostname not in result.list_vms
|
||||||
|
|
||||||
- name: wait for the install to finish - by watching the domstate
|
- name: wait for the install to finish
|
||||||
# this just keeps checking the domstate until it stops running
|
virt: command=status name={{ inventory_hostname }}
|
||||||
shell: while `/usr/bin/virsh domstate {{ inventory_hostname }} | grep -q running` ; do sleep 10; done
|
register: vmstatus
|
||||||
|
until: vmstatus.status == 'shutdown'
|
||||||
delegate_to: "{{ vmhost }}"
|
delegate_to: "{{ vmhost }}"
|
||||||
async: 1500
|
retries: 150
|
||||||
poll: 15
|
delay: 10
|
||||||
when: inventory_hostname not in result.list_vms
|
when: inventory_hostname not in result.list_vms
|
||||||
|
|
||||||
- name: start the vm up
|
- name: start the vm up
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue