You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/docker_network/tasks/tests/options.yml

95 lines
2.3 KiB
YAML

---
- name: Registering network name
set_fact:
nname_1: "{{ name_prefix ~ '-network-1' }}"
- name: Registering network name
set_fact:
dnetworks: "{{ dnetworks }} + [nname_1]"
####################################################################
## internal ########################################################
####################################################################
- name: internal
docker_network:
name: "{{ nname_1 }}"
internal: yes
register: internal_1
- name: internal (idempotency)
docker_network:
name: "{{ nname_1 }}"
internal: yes
register: internal_2
- name: internal (change)
docker_network:
name: "{{ nname_1 }}"
internal: no
register: internal_3
- name: cleanup
docker_network:
name: "{{ nname_1 }}"
state: absent
force: yes
- assert:
that:
- internal_1 is changed
- internal_2 is not changed
- internal_3 is changed
####################################################################
## driver_options ##################################################
####################################################################
- name: driver_options
docker_network:
name: "{{ nname_1 }}"
driver_options:
com.docker.network.bridge.enable_icc: 'false'
register: driver_options_1
- name: driver_options (idempotency)
docker_network:
name: "{{ nname_1 }}"
driver_options:
com.docker.network.bridge.enable_icc: 'false'
register: driver_options_2
- name: driver_options (idempotency with string translation)
docker_network:
name: "{{ nname_1 }}"
driver_options:
com.docker.network.bridge.enable_icc: False
register: driver_options_3
- name: driver_options (change)
docker_network:
name: "{{ nname_1 }}"
driver_options:
com.docker.network.bridge.enable_icc: 'true'
register: driver_options_4
- name: driver_options (idempotency with string translation)
docker_network:
name: "{{ nname_1 }}"
driver_options:
com.docker.network.bridge.enable_icc: True
register: driver_options_5
- name: cleanup
docker_network:
name: "{{ nname_1 }}"
state: absent
force: yes
- assert:
that:
- driver_options_1 is changed
- driver_options_2 is not changed
- driver_options_3 is not changed
- driver_options_4 is changed
- driver_options_5 is not changed