|
@@ -63,8 +63,9 @@
|
|
|
shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | egrep -c ''{{ instances | join("|") }}'''
|
|
|
register: nb_allocated_ips
|
|
|
until: nb_allocated_ips.stdout == '{{ instances | length }}'
|
|
|
- retries: 30
|
|
|
+ retries: 60
|
|
|
delay: 1
|
|
|
+ when: instances | length != 0
|
|
|
|
|
|
- name: Collect IP addresses of the VMs
|
|
|
shell: 'virsh -c {{ libvirt_uri }} net-dhcp-leases openshift-ansible | awk ''$6 == "{{ item }}" {gsub(/\/.*/, "", $5); print $5}'''
|
|
@@ -72,7 +73,7 @@
|
|
|
with_items: instances
|
|
|
|
|
|
- set_fact:
|
|
|
- ips: "{{ scratch_ip.results | oo_collect('stdout') }}"
|
|
|
+ ips: "{{ scratch_ip.results | default([]) | oo_collect('stdout') }}"
|
|
|
|
|
|
- name: Add new instances
|
|
|
add_host:
|