Handle ansible_default_ipv4 not there in tests. (#514) (#515)

(cherry picked from commit 6e04e1f172)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2022-12-01 00:11:38 +01:00 committed by GitHub
parent f718cfccd7
commit 098a77fe4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@
docker_swarm:
name: default
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: Parameter name should be required
docker_config:

View File

@ -262,7 +262,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 ####################

View File

@ -115,7 +115,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.

View File

@ -15,7 +15,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:

View File

@ -8,7 +8,7 @@
- name: Create a Swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: Parameter name should be required
docker_secret:

View File

@ -8,7 +8,7 @@
- name: Create a Swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: install docker_stack python requirements
pip:

View File

@ -19,7 +19,7 @@
- name: Create a swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ansible_default_ipv4.address}}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: Get docker_stack_info when docker is running and not stack available
docker_stack_info:

View File

@ -19,7 +19,7 @@
- name: Create a swarm cluster
docker_swarm:
state: present
advertise_addr: "{{ ansible_default_ipv4.address }}"
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
- name: Get docker_stack_info when docker is running and not stack available
docker_stack_info: