From 098a77fe4c5e1135b450e3e2a5ea551cea5d84de Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 1 Dec 2022 00:11:38 +0100 Subject: [PATCH] Handle ansible_default_ipv4 not there in tests. (#514) (#515) (cherry picked from commit 6e04e1f1721a7362f1ec77ec78d55ef044751cbd) Co-authored-by: Felix Fontein --- .../targets/docker_config/tasks/test_docker_config.yml | 2 +- tests/integration/targets/docker_network/tasks/tests/ipam.yml | 2 +- .../integration/targets/docker_network/tasks/tests/options.yml | 2 +- .../integration/targets/docker_network/tasks/tests/overlay.yml | 2 +- tests/integration/targets/docker_secret/tasks/test_secrets.yml | 2 +- tests/integration/targets/docker_stack/tasks/test_stack.yml | 2 +- .../targets/docker_stack_info/tasks/test_stack_info.yml | 2 +- .../docker_stack_task_info/tasks/test_stack_task_info.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/integration/targets/docker_config/tasks/test_docker_config.yml b/tests/integration/targets/docker_config/tasks/test_docker_config.yml index 4b77b538..4a75c7a2 100644 --- a/tests/integration/targets/docker_config/tasks/test_docker_config.yml +++ b/tests/integration/targets/docker_config/tasks/test_docker_config.yml @@ -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: diff --git a/tests/integration/targets/docker_network/tasks/tests/ipam.yml b/tests/integration/targets/docker_network/tasks/tests/ipam.yml index 7491150b..8647d9ad 100644 --- a/tests/integration/targets/docker_network/tasks/tests/ipam.yml +++ b/tests/integration/targets/docker_network/tasks/tests/ipam.yml @@ -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 #################### diff --git a/tests/integration/targets/docker_network/tasks/tests/options.yml b/tests/integration/targets/docker_network/tasks/tests/options.yml index ea073db3..a49eed61 100644 --- a/tests/integration/targets/docker_network/tasks/tests/options.yml +++ b/tests/integration/targets/docker_network/tasks/tests/options.yml @@ -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. diff --git a/tests/integration/targets/docker_network/tasks/tests/overlay.yml b/tests/integration/targets/docker_network/tasks/tests/overlay.yml index 832836aa..48e6557a 100644 --- a/tests/integration/targets/docker_network/tasks/tests/overlay.yml +++ b/tests/integration/targets/docker_network/tasks/tests/overlay.yml @@ -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: diff --git a/tests/integration/targets/docker_secret/tasks/test_secrets.yml b/tests/integration/targets/docker_secret/tasks/test_secrets.yml index 3d819768..2740007c 100644 --- a/tests/integration/targets/docker_secret/tasks/test_secrets.yml +++ b/tests/integration/targets/docker_secret/tasks/test_secrets.yml @@ -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: diff --git a/tests/integration/targets/docker_stack/tasks/test_stack.yml b/tests/integration/targets/docker_stack/tasks/test_stack.yml index 8d0136ac..aab1a427 100644 --- a/tests/integration/targets/docker_stack/tasks/test_stack.yml +++ b/tests/integration/targets/docker_stack/tasks/test_stack.yml @@ -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: diff --git a/tests/integration/targets/docker_stack_info/tasks/test_stack_info.yml b/tests/integration/targets/docker_stack_info/tasks/test_stack_info.yml index ca93377f..235aa380 100644 --- a/tests/integration/targets/docker_stack_info/tasks/test_stack_info.yml +++ b/tests/integration/targets/docker_stack_info/tasks/test_stack_info.yml @@ -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: diff --git a/tests/integration/targets/docker_stack_task_info/tasks/test_stack_task_info.yml b/tests/integration/targets/docker_stack_task_info/tasks/test_stack_task_info.yml index 6843fbc8..f1d890f9 100644 --- a/tests/integration/targets/docker_stack_task_info/tasks/test_stack_task_info.yml +++ b/tests/integration/targets/docker_stack_task_info/tasks/test_stack_task_info.yml @@ -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: