Handle ansible_default_ipv4 not there in tests. (#514)

This commit is contained in:
Felix Fontein
2022-12-01 00:02:02 +01:00
committed by GitHub
parent 166d485216
commit 6e04e1f172
8 changed files with 8 additions and 8 deletions
@@ -266,7 +266,7 @@
name: "{{ nname_ipam_3 }}"
state: absent
when: ansible_facts.virtualization_type != 'docker'
when: ansible_facts.virtualization_type != 'docker' and ansible_default_ipv4.alias is defined
#################### IPAM driver options ####################
@@ -119,7 +119,7 @@
- name: swarm
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
# Driver change alongside scope is intentional - bridge doesn't appear to support anything but local, and overlay can't downgrade to local. Additionally, overlay reports as swarm for swarm OR global, so no change is reported in that case.
# Test output indicates that the scope is altered, at least, so manual inspection will be required to verify this going forward, unless we come up with a test driver that supports multiple scopes.
@@ -19,7 +19,7 @@
- name: swarm
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: overlay
docker_network: