mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Use ansible_facts.xxx instead of ansible_xxx. (#1237)
This commit is contained in:
@@ -51,4 +51,4 @@
|
||||
when: docker_api_version is version('1.25', '>=') # FIXME: find out API version!
|
||||
|
||||
- ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_network tests!"
|
||||
when: not(docker_api_version is version('1.25', '>=')) and (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int > 6)
|
||||
when: not(docker_api_version is version('1.25', '>=')) and (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int > 6)
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
name: "{{ nname_ipam_3 }}"
|
||||
driver: "macvlan"
|
||||
driver_options:
|
||||
parent: "{{ ansible_default_ipv4.alias }}"
|
||||
parent: "{{ ansible_facts.default_ipv4.alias }}"
|
||||
ipam_config:
|
||||
- subnet: 10.26.120.0/24
|
||||
- subnet: 10.26.121.0/24
|
||||
@@ -220,7 +220,7 @@
|
||||
name: "{{ nname_ipam_3 }}"
|
||||
driver: "macvlan"
|
||||
driver_options:
|
||||
parent: "{{ ansible_default_ipv4.alias }}"
|
||||
parent: "{{ ansible_facts.default_ipv4.alias }}"
|
||||
ipam_config:
|
||||
- subnet: 10.26.121.0/24
|
||||
- subnet: 10.26.120.0/24
|
||||
@@ -235,7 +235,7 @@
|
||||
name: "{{ nname_ipam_3 }}"
|
||||
driver: "macvlan"
|
||||
driver_options:
|
||||
parent: "{{ ansible_default_ipv4.alias }}"
|
||||
parent: "{{ ansible_facts.default_ipv4.alias }}"
|
||||
ipam_config:
|
||||
- subnet: 10.26.120.0/24
|
||||
- subnet: 10.26.122.0/24
|
||||
@@ -252,7 +252,7 @@
|
||||
name: "{{ nname_ipam_3 }}"
|
||||
driver: "macvlan"
|
||||
driver_options:
|
||||
parent: "{{ ansible_default_ipv4.alias }}"
|
||||
parent: "{{ ansible_facts.default_ipv4.alias }}"
|
||||
ipam_config:
|
||||
- subnet: 10.26.122.0/24
|
||||
register: network
|
||||
@@ -266,7 +266,7 @@
|
||||
name: "{{ nname_ipam_3 }}"
|
||||
state: absent
|
||||
|
||||
when: ansible_facts.virtualization_type != 'docker' and ansible_default_ipv4.alias is defined
|
||||
when: ansible_facts.virtualization_type != 'docker' and ansible_facts.default_ipv4.alias is defined
|
||||
|
||||
|
||||
#################### IPAM driver options ####################
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
- name: swarm
|
||||
community.docker.docker_swarm:
|
||||
state: present
|
||||
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
|
||||
advertise_addr: "{{ ansible_facts.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.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
- name: swarm
|
||||
community.docker.docker_swarm:
|
||||
state: present
|
||||
advertise_addr: "{{ ansible_default_ipv4.address | default('127.0.0.1') }}"
|
||||
advertise_addr: "{{ ansible_facts.default_ipv4.address | default('127.0.0.1') }}"
|
||||
|
||||
####################################################################
|
||||
## overlay #########################################################
|
||||
|
||||
Reference in New Issue
Block a user