mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Adjust deprecations (#1)
* First batch of c.g 2.0.0 deprecations. * Remove use_tls and force from docker_image. * More removals. * Change community.general 3.0.0 deprecations to community.docker 2.0.0. * Fix sanity. * Fixing some bugs. * Add PR URL to fragment. ci_complete ci_coverage * Improve docs, remove superfluous code.
This commit is contained in:
@@ -11,94 +11,8 @@
|
||||
dnetworks: "{{ dnetworks + [nname_ipam_0, nname_ipam_1, nname_ipam_2, nname_ipam_3] }}"
|
||||
|
||||
|
||||
#################### Deprecated ipam_config ####################
|
||||
|
||||
- name: Create network with ipam_config and deprecated ipam_options (conflicting)
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
ipam_options:
|
||||
subnet: 172.3.29.0/24
|
||||
ipam_config:
|
||||
- subnet: 172.3.29.0/24
|
||||
register: network
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- network is failed
|
||||
- "network.msg == 'parameters are mutually exclusive: ipam_config|ipam_options'"
|
||||
|
||||
- name: Create network with deprecated custom IPAM options
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
ipam_options:
|
||||
subnet: 172.3.29.0/24
|
||||
gateway: 172.3.29.2
|
||||
iprange: 172.3.29.0/26
|
||||
aux_addresses:
|
||||
host1: 172.3.29.3
|
||||
host2: 172.3.29.4
|
||||
register: network
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- network is changed
|
||||
|
||||
- name: Create network with deprecated custom IPAM options (idempotence)
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
ipam_options:
|
||||
subnet: 172.3.29.0/24
|
||||
gateway: 172.3.29.2
|
||||
iprange: 172.3.29.0/26
|
||||
aux_addresses:
|
||||
host1: 172.3.29.3
|
||||
host2: 172.3.29.4
|
||||
register: network
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- network is not changed
|
||||
|
||||
- name: Change of network created with deprecated custom IPAM options
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
ipam_options:
|
||||
subnet: 172.3.28.0/24
|
||||
gateway: 172.3.28.2
|
||||
iprange: 172.3.28.0/26
|
||||
aux_addresses:
|
||||
host1: 172.3.28.3
|
||||
register: network
|
||||
diff: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- network is changed
|
||||
- network.diff.differences | length == 4
|
||||
- '"ipam_config[0].subnet" in network.diff.differences'
|
||||
- '"ipam_config[0].gateway" in network.diff.differences'
|
||||
- '"ipam_config[0].iprange" in network.diff.differences'
|
||||
- '"ipam_config[0].aux_addresses" in network.diff.differences'
|
||||
|
||||
- name: Remove gateway and iprange of network with deprecated custom IPAM options
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
ipam_options:
|
||||
subnet: 172.3.28.0/24
|
||||
register: network
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- network is not changed
|
||||
|
||||
- name: Cleanup network with deprecated custom IPAM options
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_0 }}"
|
||||
state: absent
|
||||
|
||||
|
||||
#################### IPv4 IPAM config ####################
|
||||
|
||||
- name: Create network with custom IPAM config
|
||||
docker_network:
|
||||
name: "{{ nname_ipam_1 }}"
|
||||
|
||||
Reference in New Issue
Block a user