Fix linting errors.

This commit is contained in:
Felix Fontein
2025-04-26 11:20:32 +02:00
parent 795e6b23dc
commit 2487d1a0bf
125 changed files with 5778 additions and 5662 deletions
@@ -56,9 +56,9 @@
- assert:
that:
- value_1 is changed
- value_2 is not changed
- value_3 is changed
- value_1 is changed
- value_2 is not changed
- value_3 is changed
####################################################################
## list ############################################################
@@ -71,8 +71,8 @@
name: "{{ cname }}"
state: started
dns_servers:
- 1.1.1.1
- 8.8.8.8
- 1.1.1.1
- 8.8.8.8
register: list_1
- name: list (change, ignore)
@@ -82,7 +82,7 @@
name: "{{ cname }}"
state: started
dns_servers:
- 9.9.9.9
- 9.9.9.9
force_kill: true
comparisons:
dns_servers: ignore
@@ -95,7 +95,7 @@
name: "{{ cname }}"
state: started
dns_servers:
- 9.9.9.9
- 9.9.9.9
force_kill: true
comparisons:
dns_servers: strict
@@ -110,9 +110,9 @@
- assert:
that:
- list_1 is changed
- list_2 is not changed
- list_3 is changed
- list_1 is changed
- list_2 is not changed
- list_3 is changed
####################################################################
## set #############################################################
@@ -125,8 +125,8 @@
name: "{{ cname }}"
state: started
groups:
- "1010"
- "1011"
- "1010"
- "1011"
register: set_1
- name: set (change, ignore)
@@ -136,9 +136,9 @@
name: "{{ cname }}"
state: started
groups:
- "1010"
- "1011"
- "1012"
- "1010"
- "1011"
- "1012"
force_kill: true
comparisons:
groups: ignore
@@ -151,9 +151,9 @@
name: "{{ cname }}"
state: started
groups:
- "1010"
- "1011"
- "1012"
- "1010"
- "1011"
- "1012"
force_kill: true
comparisons:
groups: allow_more_present
@@ -166,8 +166,8 @@
name: "{{ cname }}"
state: started
groups:
- "1010"
- "1012"
- "1010"
- "1012"
force_kill: true
comparisons:
groups: allow_more_present
@@ -180,8 +180,8 @@
name: "{{ cname }}"
state: started
groups:
- "1010"
- "1012"
- "1010"
- "1012"
force_kill: true
comparisons:
groups: strict
@@ -196,11 +196,11 @@
- assert:
that:
- set_1 is changed
- set_2 is not changed
- set_3 is changed
- set_4 is not changed
- set_5 is changed
- set_1 is changed
- set_2 is not changed
- set_3 is changed
- set_4 is not changed
- set_5 is changed
####################################################################
## set(dict) #######################################################
@@ -213,8 +213,8 @@
name: "{{ cname }}"
state: started
devices:
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
register: set_dict_1
- name: set(dict) (change, ignore)
@@ -224,9 +224,9 @@
name: "{{ cname }}"
state: started
devices:
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
- "/dev/null:/dev/virt-null:rwm"
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
- "/dev/null:/dev/virt-null:rwm"
force_kill: true
comparisons:
devices: ignore
@@ -239,9 +239,9 @@
name: "{{ cname }}"
state: started
devices:
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
- "/dev/null:/dev/virt-null:rwm"
- "/dev/random:/dev/virt-random:rwm"
- "/dev/urandom:/dev/virt-urandom:rwm"
- "/dev/null:/dev/virt-null:rwm"
force_kill: true
comparisons:
devices: allow_more_present
@@ -254,8 +254,8 @@
name: "{{ cname }}"
state: started
devices:
- "/dev/random:/dev/virt-random:rwm"
- "/dev/null:/dev/virt-null:rwm"
- "/dev/random:/dev/virt-random:rwm"
- "/dev/null:/dev/virt-null:rwm"
force_kill: true
comparisons:
devices: allow_more_present
@@ -268,8 +268,8 @@
name: "{{ cname }}"
state: started
devices:
- "/dev/random:/dev/virt-random:rwm"
- "/dev/null:/dev/virt-null:rwm"
- "/dev/random:/dev/virt-random:rwm"
- "/dev/null:/dev/virt-null:rwm"
force_kill: true
comparisons:
devices: strict
@@ -284,11 +284,11 @@
- assert:
that:
- set_dict_1 is changed
- set_dict_2 is not changed
- set_dict_3 is changed
- set_dict_4 is not changed
- set_dict_5 is changed
- set_dict_1 is changed
- set_dict_2 is not changed
- set_dict_3 is changed
- set_dict_4 is not changed
- set_dict_5 is changed
####################################################################
## dict ############################################################
@@ -372,11 +372,11 @@
- assert:
that:
- dict_1 is changed
- dict_2 is not changed
- dict_3 is changed
- dict_4 is not changed
- dict_5 is changed
- dict_1 is changed
- dict_2 is not changed
- dict_3 is changed
- dict_4 is not changed
- dict_5 is changed
####################################################################
## wildcard ########################################################
@@ -460,7 +460,7 @@
- assert:
that:
- wildcard_1 is changed
- wildcard_2 is not changed
- wildcard_3 is changed
- wildcard_4 is not changed
- wildcard_1 is changed
- wildcard_2 is not changed
- wildcard_3 is changed
- wildcard_4 is not changed
@@ -60,10 +60,10 @@
- assert:
that:
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
####################################################################
## container_default_behavior: no_defaults #########################
@@ -116,7 +116,7 @@
- assert:
that:
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
@@ -22,8 +22,8 @@
- name: Get image ID of {{ docker_test_image_hello_world }} and {{ docker_test_image_alpine }} images
docker_image_info:
name:
- "{{ docker_test_image_hello_world }}"
- "{{ docker_test_image_alpine }}"
- "{{ docker_test_image_hello_world }}"
- "{{ docker_test_image_alpine }}"
register: image_info
- assert:
@@ -29,13 +29,13 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
- source: /
target: /whatever
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
- source: /
target: /whatever
type: bind
read_only: false
register: mounts_1
- name: mounts (idempotency)
@@ -45,13 +45,13 @@
name: "{{ cname }}"
state: started
mounts:
- source: /
target: /whatever
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
- source: /
target: /whatever
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
register: mounts_2
- name: mounts (less mounts)
@@ -61,9 +61,9 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
- source: /tmp
target: /tmp
type: bind
register: mounts_3
- name: mounts (more mounts)
@@ -73,13 +73,13 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
- source: /tmp
target: /somewhereelse
type: bind
read_only: true
- source: /tmp
target: /tmp
type: bind
- source: /tmp
target: /somewhereelse
type: bind
read_only: true
force_kill: true
register: mounts_4
@@ -90,13 +90,13 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
- source: /tmp
target: /somewhereelse
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
- source: /tmp
target: /somewhereelse
type: bind
read_only: false
force_kill: true
register: mounts_5
@@ -107,13 +107,13 @@
name: "{{ cname }}"
state: started
mounts:
- source: /home
target: /x
type: bind
- source: /etc
target: /x
type: bind
read_only: false
- source: /home
target: /x
type: bind
- source: /etc
target: /x
type: bind
read_only: false
force_kill: true
register: mounts_6
ignore_errors: true
@@ -151,15 +151,15 @@
- assert:
that:
- mounts_1 is changed
- mounts_2 is not changed
- mounts_3 is not changed
- mounts_4 is changed
- mounts_5 is changed
- mounts_6 is failed
- "'The mount point \"/x\" appears twice in the mounts option' == mounts_6.msg"
- mounts_7 is changed
- mounts_8 is not changed
- mounts_1 is changed
- mounts_2 is not changed
- mounts_3 is not changed
- mounts_4 is changed
- mounts_5 is changed
- mounts_6 is failed
- "'The mount point \"/x\" appears twice in the mounts option' == mounts_6.msg"
- mounts_7 is changed
- mounts_8 is not changed
####################################################################
## tmpfs ###########################################################
@@ -172,14 +172,14 @@
name: "{{ cname }}"
state: started
mounts:
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
force_kill: true
register: tmpfs_1
@@ -190,14 +190,14 @@
name: "{{ cname }}"
state: started
mounts:
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
force_kill: true
register: tmpfs_2
@@ -208,18 +208,18 @@
name: "{{ cname }}"
state: started
mounts:
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache3
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache2
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
- target: /cache3
type: tmpfs
tmpfs_mode: "1777"
tmpfs_size: "1GB"
force_kill: true
register: tmpfs_3
@@ -230,10 +230,10 @@
name: "{{ cname }}"
state: started
mounts:
- target: /cache1
type: tmpfs
tmpfs_mode: "1700"
tmpfs_size: "1GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1700"
tmpfs_size: "1GB"
force_kill: true
register: tmpfs_4
@@ -244,10 +244,10 @@
name: "{{ cname }}"
state: started
mounts:
- target: /cache1
type: tmpfs
tmpfs_mode: "1700"
tmpfs_size: "2GB"
- target: /cache1
type: tmpfs
tmpfs_mode: "1700"
tmpfs_size: "2GB"
force_kill: true
register: tmpfs_5
@@ -260,11 +260,11 @@
- assert:
that:
- tmpfs_1 is changed
- tmpfs_2 is not changed
- tmpfs_3 is changed
- tmpfs_4 is changed
- tmpfs_5 is changed
- tmpfs_1 is changed
- tmpfs_2 is not changed
- tmpfs_3 is changed
- tmpfs_4 is changed
- tmpfs_5 is changed
####################################################################
## mounts + volumes ################################################
@@ -277,12 +277,12 @@
name: "{{ cname }}"
state: started
mounts:
- source: /
target: /whatever
type: bind
read_only: true
- source: /
target: /whatever
type: bind
read_only: true
volumes:
- /tmp:/tmp
- /tmp:/tmp
register: mounts_volumes_1
- name: mounts + volumes (idempotency)
@@ -292,12 +292,12 @@
name: "{{ cname }}"
state: started
mounts:
- source: /
target: /whatever
type: bind
read_only: true
- source: /
target: /whatever
type: bind
read_only: true
volumes:
- /tmp:/tmp
- /tmp:/tmp
register: mounts_volumes_2
- name: mounts + volumes (switching)
@@ -307,12 +307,12 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
read_only: false
volumes:
- /:/whatever:ro
- /:/whatever:ro
force_kill: true
register: mounts_volumes_3
@@ -323,12 +323,12 @@
name: "{{ cname }}"
state: started
mounts:
- source: /tmp
target: /tmp
type: bind
read_only: false
- source: /tmp
target: /tmp
type: bind
read_only: false
volumes:
- /tmp:/tmp
- /tmp:/tmp
force_kill: true
register: mounts_volumes_4
ignore_errors: true
@@ -342,11 +342,11 @@
- assert:
that:
- mounts_volumes_1 is changed
- mounts_volumes_2 is not changed
- mounts_volumes_3 is changed
- mounts_volumes_4 is failed
- "'The mount point \"/tmp\" appears both in the volumes and mounts option' in mounts_volumes_4.msg"
- mounts_volumes_1 is changed
- mounts_volumes_2 is not changed
- mounts_volumes_3 is changed
- mounts_volumes_4 is failed
- "'The mount point \"/tmp\" appears both in the volumes and mounts option' in mounts_volumes_4.msg"
####################################################################
## volume_driver ###################################################
@@ -389,9 +389,9 @@
- assert:
that:
- volume_driver_1 is changed
- volume_driver_2 is not changed
- volume_driver_3 is changed
- volume_driver_1 is changed
- volume_driver_2 is not changed
- volume_driver_3 is changed
####################################################################
## volumes #########################################################
@@ -404,9 +404,9 @@
name: "{{ cname }}"
state: started
volumes:
- "/tmp:/tmp"
- "/:/whatever:rw,z"
- "/anon:rw"
- "/tmp:/tmp"
- "/:/whatever:rw,z"
- "/anon:rw"
register: volumes_1
- name: volumes (idempotency)
@@ -416,9 +416,9 @@
name: "{{ cname }}"
state: started
volumes:
- "/:/whatever:rw,z"
- "/tmp:/tmp"
- "/anon:rw"
- "/:/whatever:rw,z"
- "/tmp:/tmp"
- "/anon:rw"
register: volumes_2
- name: volumes (less volumes)
@@ -428,7 +428,7 @@
name: "{{ cname }}"
state: started
volumes:
- "/tmp:/tmp"
- "/tmp:/tmp"
register: volumes_3
- name: volumes (more volumes)
@@ -438,8 +438,8 @@
name: "{{ cname }}"
state: started
volumes:
- "/tmp:/tmp"
- "/tmp:/somewhereelse:ro,Z"
- "/tmp:/tmp"
- "/tmp:/somewhereelse:ro,Z"
force_kill: true
register: volumes_4
@@ -450,8 +450,8 @@
name: "{{ cname }}"
state: started
volumes:
- "/tmp:/tmp"
- "/tmp:/somewhereelse:ro"
- "/tmp:/tmp"
- "/tmp:/somewhereelse:ro"
force_kill: true
register: volumes_5
@@ -462,8 +462,8 @@
name: "{{ cname }}"
state: started
volumes:
- "/etc:/tmp"
- "/home:/tmp:ro"
- "/etc:/tmp"
- "/home:/tmp:ro"
force_kill: true
register: volumes_6
ignore_errors: true
@@ -477,16 +477,16 @@
- assert:
that:
- volumes_1 is changed
- volumes_1.container.Config.Volumes | length == 1
- volumes_1.container.Config.Volumes['/anon:rw'] | length == 0
- volumes_2 is not changed
- volumes_3 is not changed
- volumes_4 is changed
- not volumes_4.container.Config.Volumes
- volumes_5 is changed
- volumes_6 is failed
- "'The mount point \"/tmp\" appears twice in the volumes option' in volumes_6.msg"
- volumes_1 is changed
- volumes_1.container.Config.Volumes | length == 1
- volumes_1.container.Config.Volumes['/anon:rw'] | length == 0
- volumes_2 is not changed
- volumes_3 is not changed
- volumes_4 is changed
- not volumes_4.container.Config.Volumes
- volumes_5 is changed
- volumes_6 is failed
- "'The mount point \"/tmp\" appears twice in the volumes option' in volumes_6.msg"
####################################################################
## volumes_from ####################################################
@@ -499,10 +499,10 @@
name: "{{ container_name }}"
state: started
volumes:
- "{{ '/tmp:/tmp' if container_name == cname_h1 else '/:/whatever:ro' }}"
- "{{ '/tmp:/tmp' if container_name == cname_h1 else '/:/whatever:ro' }}"
loop:
- "{{ cname_h1 }}"
- "{{ cname_h2 }}"
- "{{ cname_h1 }}"
- "{{ cname_h2 }}"
loop_control:
loop_var: container_name
@@ -540,18 +540,18 @@
state: absent
force_kill: true
loop:
- "{{ cname }}"
- "{{ cname_h1 }}"
- "{{ cname_h2 }}"
- "{{ cname }}"
- "{{ cname_h1 }}"
- "{{ cname_h2 }}"
loop_control:
loop_var: container_name
diff: false
- assert:
that:
- volumes_from_1 is changed
- volumes_from_2 is not changed
- volumes_from_3 is changed
- volumes_from_1 is changed
- volumes_from_2 is not changed
- volumes_from_3 is changed
####################################################################
####################################################################
@@ -20,8 +20,8 @@
name: "{{ network_name }}"
state: present
loop:
- "{{ nname_1 }}"
- "{{ nname_2 }}"
- "{{ nname_1 }}"
- "{{ nname_2 }}"
loop_control:
loop_var: network_name
@@ -126,24 +126,24 @@
state: absent
force_kill: true
loop:
- "{{ cname }}"
- "{{ cname_h1 }}"
- "{{ cname }}"
- "{{ cname_h1 }}"
loop_control:
loop_var: container_name
diff: false
- assert:
that:
- network_mode_1 is changed
- network_mode_1.container.HostConfig.NetworkMode == 'host'
- network_mode_2 is not changed
- network_mode_2.container.HostConfig.NetworkMode == 'host'
- network_mode_3 is changed
- network_mode_3.container.HostConfig.NetworkMode == 'none'
- network_mode_4 is changed
- network_mode_4.container.HostConfig.NetworkMode == ('container:' ~ cname_h1_id.container.Id)
- network_mode_5 is not changed
- network_mode_5.container.HostConfig.NetworkMode == ('container:' ~ cname_h1_id.container.Id)
- network_mode_1 is changed
- network_mode_1.container.HostConfig.NetworkMode == 'host'
- network_mode_2 is not changed
- network_mode_2.container.HostConfig.NetworkMode == 'host'
- network_mode_3 is changed
- network_mode_3.container.HostConfig.NetworkMode == 'none'
- network_mode_4 is changed
- network_mode_4.container.HostConfig.NetworkMode == ('container:' ~ cname_h1_id.container.Id)
- network_mode_5 is not changed
- network_mode_5.container.HostConfig.NetworkMode == ('container:' ~ cname_h1_id.container.Id)
####################################################################
## networks, purge_networks for networks_cli_compatible=no #########
@@ -156,8 +156,8 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: false
register: networks_1
@@ -168,8 +168,8 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: false
register: networks_2
@@ -182,8 +182,8 @@
comparisons:
networks: strict
networks:
- name: bridge
- name: "{{ nname_1 }}"
- name: bridge
- name: "{{ nname_1 }}"
networks_cli_compatible: false
force_kill: true
register: networks_3
@@ -197,8 +197,8 @@
comparisons:
networks: strict
networks:
- name: "{{ nname_1 }}"
- name: bridge
- name: "{{ nname_1 }}"
- name: bridge
networks_cli_compatible: false
register: networks_4
@@ -209,7 +209,7 @@
name: "{{ cname }}"
state: started
networks:
- name: bridge
- name: bridge
networks_cli_compatible: false
register: networks_5
@@ -222,7 +222,7 @@
comparisons:
networks: strict
networks:
- name: bridge
- name: bridge
networks_cli_compatible: false
force_kill: true
register: networks_6
@@ -236,8 +236,8 @@
comparisons:
networks: strict
networks:
- name: bridge
- name: "{{ nname_2 }}"
- name: bridge
- name: "{{ nname_2 }}"
networks_cli_compatible: false
force_kill: true
register: networks_7
@@ -251,42 +251,42 @@
- assert:
that:
# networks_1 has networks default, 'bridge', nname_1
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 3
- nname_1 in networks_1.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
- "'default' in networks_1.container.NetworkSettings.Networks or 'bridge' in networks_1.container.NetworkSettings.Networks"
# networks_2 has networks default, 'bridge', nname_1
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 3
- nname_1 in networks_2.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
- "'default' in networks_1.container.NetworkSettings.Networks or 'bridge' in networks_1.container.NetworkSettings.Networks"
# networks_3 has networks 'bridge', nname_1
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_3.container.NetworkSettings.Networks
- "'default' in networks_3.container.NetworkSettings.Networks or 'bridge' in networks_3.container.NetworkSettings.Networks"
# networks_4 has networks 'bridge', nname_1
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_4.container.NetworkSettings.Networks
- "'default' in networks_4.container.NetworkSettings.Networks or 'bridge' in networks_4.container.NetworkSettings.Networks"
# networks_5 has networks 'bridge', nname_1
- networks_5 is not changed
- networks_5.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_5.container.NetworkSettings.Networks
- "'default' in networks_5.container.NetworkSettings.Networks or 'bridge' in networks_5.container.NetworkSettings.Networks"
# networks_6 has networks 'bridge'
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- "'default' in networks_6.container.NetworkSettings.Networks or 'bridge' in networks_6.container.NetworkSettings.Networks"
# networks_7 has networks 'bridge', nname_2
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks | length == 2
- nname_2 in networks_7.container.NetworkSettings.Networks
- "'default' in networks_7.container.NetworkSettings.Networks or 'bridge' in networks_7.container.NetworkSettings.Networks"
# networks_1 has networks default, 'bridge', nname_1
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 3
- nname_1 in networks_1.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
- "'default' in networks_1.container.NetworkSettings.Networks or 'bridge' in networks_1.container.NetworkSettings.Networks"
# networks_2 has networks default, 'bridge', nname_1
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 3
- nname_1 in networks_2.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
- "'default' in networks_1.container.NetworkSettings.Networks or 'bridge' in networks_1.container.NetworkSettings.Networks"
# networks_3 has networks 'bridge', nname_1
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_3.container.NetworkSettings.Networks
- "'default' in networks_3.container.NetworkSettings.Networks or 'bridge' in networks_3.container.NetworkSettings.Networks"
# networks_4 has networks 'bridge', nname_1
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_4.container.NetworkSettings.Networks
- "'default' in networks_4.container.NetworkSettings.Networks or 'bridge' in networks_4.container.NetworkSettings.Networks"
# networks_5 has networks 'bridge', nname_1
- networks_5 is not changed
- networks_5.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_5.container.NetworkSettings.Networks
- "'default' in networks_5.container.NetworkSettings.Networks or 'bridge' in networks_5.container.NetworkSettings.Networks"
# networks_6 has networks 'bridge'
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- "'default' in networks_6.container.NetworkSettings.Networks or 'bridge' in networks_6.container.NetworkSettings.Networks"
# networks_7 has networks 'bridge', nname_2
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks | length == 2
- nname_2 in networks_7.container.NetworkSettings.Networks
- "'default' in networks_7.container.NetworkSettings.Networks or 'bridge' in networks_7.container.NetworkSettings.Networks"
####################################################################
## networks for networks_cli_compatible=yes ########################
@@ -299,11 +299,11 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_1 }}"
aliases:
- alias1
- alias2
- name: "{{ nname_2 }}"
- name: "{{ nname_1 }}"
aliases:
- alias1
- alias2
- name: "{{ nname_2 }}"
networks_cli_compatible: true
register: networks_1
@@ -314,8 +314,8 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
- name: "{{ nname_1 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: true
register: networks_2
@@ -409,38 +409,38 @@
- assert:
that:
# networks_1 has networks nname_1, nname_2
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_1.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
# networks_2 has networks nname_1, nname_2
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_2.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
# networks_3 has networks 'bridge'
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks | length == 1
- "'default' in networks_3.container.NetworkSettings.Networks or 'bridge' in networks_3.container.NetworkSettings.Networks"
# networks_4 has networks 'bridge'
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 1
- "'default' in networks_4.container.NetworkSettings.Networks or 'bridge' in networks_4.container.NetworkSettings.Networks"
# networks_5 has no networks
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks | length == 0
# networks_6 has networks 'bridge'
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- "'default' in networks_6.container.NetworkSettings.Networks or 'bridge' in networks_6.container.NetworkSettings.Networks"
# networks_7 has networks 'bridge'
- networks_7 is not changed
- networks_7.container.NetworkSettings.Networks | length == 1
- "'default' in networks_7.container.NetworkSettings.Networks or 'bridge' in networks_7.container.NetworkSettings.Networks"
# networks_8 has no networks
- networks_8 is changed
- networks_8.container.NetworkSettings.Networks | length == 0
# networks_1 has networks nname_1, nname_2
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_1.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
# networks_2 has networks nname_1, nname_2
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_2.container.NetworkSettings.Networks
- nname_2 in networks_1.container.NetworkSettings.Networks
# networks_3 has networks 'bridge'
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks | length == 1
- "'default' in networks_3.container.NetworkSettings.Networks or 'bridge' in networks_3.container.NetworkSettings.Networks"
# networks_4 has networks 'bridge'
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 1
- "'default' in networks_4.container.NetworkSettings.Networks or 'bridge' in networks_4.container.NetworkSettings.Networks"
# networks_5 has no networks
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks | length == 0
# networks_6 has networks 'bridge'
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- "'default' in networks_6.container.NetworkSettings.Networks or 'bridge' in networks_6.container.NetworkSettings.Networks"
# networks_7 has networks 'bridge'
- networks_7 is not changed
- networks_7.container.NetworkSettings.Networks | length == 1
- "'default' in networks_7.container.NetworkSettings.Networks or 'bridge' in networks_7.container.NetworkSettings.Networks"
# networks_8 has no networks
- networks_8 is changed
- networks_8.container.NetworkSettings.Networks | length == 0
####################################################################
## networks with comparisons #######################################
@@ -453,7 +453,7 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_1 }}"
- name: "{{ nname_1 }}"
networks_cli_compatible: true
register: networks_1
@@ -464,7 +464,7 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_2 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: true
comparisons:
network_mode: ignore # otherwise we'd have to set network_mode to nname_1
@@ -502,7 +502,7 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_2 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: true
comparisons:
network_mode: ignore # otherwise we'd have to set network_mode to nname_1
@@ -517,7 +517,7 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_2 }}"
- name: "{{ nname_2 }}"
networks_cli_compatible: true
comparisons:
networks: strict
@@ -546,34 +546,34 @@
- assert:
that:
# networks_1 has networks nname_1
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_1.container.NetworkSettings.Networks
# networks_2 has networks nname_1
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_2.container.NetworkSettings.Networks
# networks_3 has networks nname_1
- networks_3 is not changed
- networks_3.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_3.container.NetworkSettings.Networks
# networks_4 has networks nname_1
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_4.container.NetworkSettings.Networks
# networks_5 has networks nname_1, nname_2
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_5.container.NetworkSettings.Networks
- nname_2 in networks_5.container.NetworkSettings.Networks
# networks_6 has networks nname_2
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- nname_2 in networks_6.container.NetworkSettings.Networks
# networks_7 has no networks
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks | length == 0
# networks_1 has networks nname_1
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_1.container.NetworkSettings.Networks
# networks_2 has networks nname_1
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_2.container.NetworkSettings.Networks
# networks_3 has networks nname_1
- networks_3 is not changed
- networks_3.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_3.container.NetworkSettings.Networks
# networks_4 has networks nname_1
- networks_4 is not changed
- networks_4.container.NetworkSettings.Networks | length == 1
- nname_1 in networks_4.container.NetworkSettings.Networks
# networks_5 has networks nname_1, nname_2
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks | length == 2
- nname_1 in networks_5.container.NetworkSettings.Networks
- nname_2 in networks_5.container.NetworkSettings.Networks
# networks_6 has networks nname_2
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks | length == 1
- nname_2 in networks_6.container.NetworkSettings.Networks
# networks_7 has no networks
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks | length == 0
####################################################################
## networks with IP address ########################################
@@ -586,9 +586,9 @@
name: "{{ cname }}"
state: stopped
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_2 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_2 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
networks_cli_compatible: true
register: networks_1
@@ -599,9 +599,9 @@
name: "{{ cname }}"
state: stopped
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_2 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_2 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
networks_cli_compatible: true
register: networks_2
@@ -612,9 +612,9 @@
name: "{{ cname }}"
state: stopped
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_3 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_3 }}"
ipv6_address: "{{ nname_3_ipv6_2 }}"
networks_cli_compatible: true
register: networks_3
@@ -625,9 +625,9 @@
name: "{{ cname }}"
state: stopped
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_3 }}"
ipv6_address: "{{ nname_3_ipv6_3 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_3 }}"
ipv6_address: "{{ nname_3_ipv6_3 }}"
networks_cli_compatible: true
register: networks_4
@@ -644,9 +644,9 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_3 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_3 }}"
networks_cli_compatible: true
force_kill: true
register: networks_6
@@ -658,9 +658,9 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_4 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_4 }}"
networks_cli_compatible: true
force_kill: true
register: networks_7
@@ -672,9 +672,9 @@
name: "{{ cname }}"
state: started
networks:
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_4 }}"
- name: "{{ nname_3 }}"
ipv4_address: "{{ nname_3_ipv4_4 }}"
ipv6_address: "{{ nname_3_ipv6_4 }}"
networks_cli_compatible: true
register: networks_8
@@ -687,46 +687,46 @@
- assert:
that:
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_2
- networks_1.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_1.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_1.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_2
- networks_2.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_2.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_2.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_3.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_3.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_3.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_4 is changed
- networks_4.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_4.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_4.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_4.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_5.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_5.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_3
- networks_5.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_6.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_6.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_6.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_7.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_7.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_7.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_8 is not changed
- networks_8.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_8.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_8.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_8.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_1 is changed
- networks_1.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_2
- networks_1.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_1.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_1.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_2 is not changed
- networks_2.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_2
- networks_2.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_2.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_2.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_3 is changed
- networks_3.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_3.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_2 | normalize_ipaddr
- networks_3.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_3.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_4 is changed
- networks_4.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_4.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_4.container.NetworkSettings.Networks[nname_3].IPAddress == ""
- networks_4.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address == ""
- networks_5 is changed
- networks_5.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_3
- networks_5.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_5.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_3
- networks_5.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_6 is changed
- networks_6.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_6.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_6.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_6.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_3 | normalize_ipaddr
- networks_7 is changed
- networks_7.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_7.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_7.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_7.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_8 is not changed
- networks_8.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv4Address == nname_3_ipv4_4
- networks_8.container.NetworkSettings.Networks[nname_3].IPAMConfig.IPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
- networks_8.container.NetworkSettings.Networks[nname_3].IPAddress == nname_3_ipv4_4
- networks_8.container.NetworkSettings.Networks[nname_3].GlobalIPv6Address | normalize_ipaddr == nname_3_ipv6_4 | normalize_ipaddr
####################################################################
####################################################################
@@ -738,8 +738,8 @@
state: absent
force: true
loop:
- "{{ nname_1 }}"
- "{{ nname_2 }}"
- "{{ nname_3 }}"
- "{{ nname_1 }}"
- "{{ nname_2 }}"
- "{{ nname_3 }}"
loop_control:
loop_var: network_name
File diff suppressed because it is too large Load Diff
@@ -22,7 +22,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "[::1:2000:3000"
- "[::1:2000:3000"
register: published_ports_1
ignore_errors: true
@@ -33,7 +33,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "::1:2000:3000"
- "::1:2000:3000"
register: published_ports_2
ignore_errors: true
@@ -44,7 +44,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "foo:2000:3000"
- "foo:2000:3000"
register: published_ports_3
ignore_errors: true
@@ -68,11 +68,11 @@
name: "{{ cname }}"
state: started
exposed_ports:
- "9001"
- "9010-9050"
- "9001"
- "9010-9050"
published_ports:
- "9001:9001"
- "9010-9050:9010-9050"
- "9001:9001"
- "9010-9050:9010-9050"
force_kill: true
register: published_ports_1
@@ -83,11 +83,11 @@
name: "{{ cname }}"
state: started
exposed_ports:
- "9001"
- "9010-9050"
- "9001"
- "9010-9050"
published_ports:
- "9001:9001"
- "9010-9050:9010-9050"
- "9001:9001"
- "9010-9050:9010-9050"
force_kill: true
register: published_ports_2
@@ -98,11 +98,11 @@
name: "{{ cname }}"
state: started
exposed_ports:
- "9001"
- "9010-9050"
- "9001"
- "9010-9050"
published_ports:
- "9001:9001"
- "9020-9060:9020-9060"
- "9001:9001"
- "9020-9060:9020-9060"
force_kill: true
register: published_ports_3
@@ -115,9 +115,9 @@
- assert:
that:
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
####################################################################
## published_ports: one-element container port range ###############
@@ -130,7 +130,7 @@
name: "{{ item }}"
state: started
published_ports:
- "9010-9050:9010"
- "9010-9050:9010"
force_kill: true
loop:
- '{{ cname }}'
@@ -144,7 +144,7 @@
name: "{{ item }}"
state: started
published_ports:
- "9010-9050:9010"
- "9010-9050:9010"
force_kill: true
loop:
- '{{ cname }}'
@@ -158,7 +158,7 @@
name: "{{ item }}"
state: started
published_ports:
- "9010-9051:9010"
- "9010-9051:9010"
force_kill: true
loop:
- '{{ cname }}'
@@ -177,9 +177,9 @@
- assert:
that:
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
####################################################################
## published_ports: IPv6 addresses #################################
@@ -194,7 +194,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "[::1]:9001:9001"
- "[::1]:9001:9001"
force_kill: true
register: published_ports_1
@@ -205,7 +205,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "[::1]:9001:9001"
- "[::1]:9001:9001"
force_kill: true
register: published_ports_2
@@ -216,7 +216,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "127.0.0.1:9001:9001"
- "127.0.0.1:9001:9001"
force_kill: true
register: published_ports_3
@@ -227,7 +227,7 @@
name: "{{ cname }}"
state: started
published_ports:
- "localhost:9001:9001"
- "localhost:9001:9001"
force_kill: true
register: published_ports_4
ignore_errors: true
@@ -241,10 +241,10 @@
- assert:
that:
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
- published_ports_4 is failed
- published_ports_1 is changed
- published_ports_2 is not changed
- published_ports_3 is changed
- published_ports_4 is failed
####################################################################
## publish_all_ports ###############################################
@@ -29,10 +29,10 @@
# before the container is stopped (see
# https://github.com/ansible/ansible/issues/45486).
networks:
- name: "nonexistant-network-{{ (2**32) | random }}"
- name: "nonexistant-network-{{ (2**32) | random }}"
published_ports:
- '1:2'
- '3'
- '1:2'
- '3'
links:
- "nonexistant-container-{{ (2**32) | random }}:test"
- "nonexistant-container-{{ (2**32) | random }}:test"
state: absent
@@ -50,10 +50,10 @@
- assert:
that:
- create_1 is changed
- create_2 is changed
- create_3 is not changed
- create_4 is not changed
- create_1 is changed
- create_2 is changed
- create_3 is not changed
- create_4 is not changed
####################################################################
## Starting (after creation) #######################################
@@ -87,10 +87,10 @@
- assert:
that:
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
- start_1 is changed
- start_2 is changed
- start_3 is not changed
- start_4 is not changed
####################################################################
## Present check for running container #############################
@@ -115,8 +115,8 @@
- assert:
that:
- present_check_1 is not changed
- present_check_2 is not changed
- present_check_1 is not changed
- present_check_2 is not changed
####################################################################
## Starting (from scratch) #########################################
@@ -168,10 +168,10 @@
- assert:
that:
- start_scratch_1 is changed
- start_scratch_2 is changed
- start_scratch_3 is not changed
- start_scratch_4 is not changed
- start_scratch_1 is changed
- start_scratch_2 is changed
- start_scratch_3 is not changed
- start_scratch_4 is not changed
####################################################################
## Recreating ######################################################
@@ -253,16 +253,16 @@
- assert:
that:
- recreate_2 is changed
- recreate_3 is changed
- recreate_4 is changed
- recreate_5 is changed
- recreate_6 is changed
- recreate_1.container.Id == recreate_2.container.Id
- recreate_1.container.Id != recreate_3.container.Id
- recreate_3.container.Id == recreate_4.container.Id
- recreate_4.container.Id == recreate_5.container.Id
- recreate_4.container.Id != recreate_6.container.Id
- recreate_2 is changed
- recreate_3 is changed
- recreate_4 is changed
- recreate_5 is changed
- recreate_6 is changed
- recreate_1.container.Id == recreate_2.container.Id
- recreate_1.container.Id != recreate_3.container.Id
- recreate_3.container.Id == recreate_4.container.Id
- recreate_4.container.Id == recreate_5.container.Id
- recreate_4.container.Id != recreate_6.container.Id
####################################################################
## Restarting ######################################################
@@ -276,7 +276,7 @@
state: started
stop_timeout: 1
volumes:
- /tmp/tmp
- /tmp/tmp
register: restart_1
- name: Restarting (restart, check mode)
@@ -310,7 +310,7 @@
state: started
stop_timeout: 1
volumes:
- /tmp/tmp
- /tmp/tmp
register: restart_4
- name: cleanup
@@ -322,11 +322,11 @@
- assert:
that:
- restart_1 is changed
- restart_2 is changed
- restart_3 is changed
- restart_1.container.Id == restart_3.container.Id
- restart_4 is not changed
- restart_1 is changed
- restart_2 is changed
- restart_3 is changed
- restart_1.container.Id == restart_3.container.Id
- restart_4 is not changed
####################################################################
## Stopping ########################################################
@@ -368,10 +368,10 @@
- assert:
that:
- stop_1 is changed
- stop_2 is changed
- stop_3 is not changed
- stop_4 is not changed
- stop_1 is changed
- stop_2 is changed
- stop_3 is not changed
- stop_4 is not changed
####################################################################
## Removing ########################################################
@@ -405,10 +405,10 @@
- assert:
that:
- remove_1 is changed
- remove_2 is changed
- remove_3 is not changed
- remove_4 is not changed
- remove_1 is changed
- remove_2 is changed
- remove_3 is not changed
- remove_4 is not changed
####################################################################
## Removing (from running) #########################################
@@ -453,7 +453,7 @@
- assert:
that:
- remove_from_running_1 is changed
- remove_from_running_2 is changed
- remove_from_running_3 is not changed
- remove_from_running_4 is not changed
- remove_from_running_1 is changed
- remove_from_running_2 is changed
- remove_from_running_3 is not changed
- remove_from_running_4 is not changed
@@ -131,91 +131,91 @@
- name: Check general things
assert:
that:
- create is changed
- update is changed
- update2 is changed
- recreate is changed
- create is changed
- update is changed
- update2 is changed
- recreate is changed
# Make sure the container was *not* recreated when it should not be
- create.container.Id == update.container.Id
- create.container.Id == update2.container.Id
# Make sure the container was *not* recreated when it should not be
- create.container.Id == update.container.Id
- create.container.Id == update2.container.Id
# Make sure that the container was recreated when it should be
- create.container.Id != recreate.container.Id
# Make sure that the container was recreated when it should be
- create.container.Id != recreate.container.Id
- name: Check diff for first update
assert:
that:
# blkio_weight sometimes cannot be set, then we end up with 0 instead of the value we had
- >-
not has_blkio_weight or update.diff.before.blkio_weight == 123 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or update.diff.after.blkio_weight == 234
- update.diff.before.cpu_period == 90000
- update.diff.after.cpu_period == 50000
- update.diff.before.cpu_quota == 150000
- update.diff.after.cpu_quota == 50000
- update.diff.before.cpu_shares == 900
- update.diff.after.cpu_shares == 1100
- update.diff.before.memory == 67108864
- update.diff.after.memory == 50331648
- update.diff.before.memory_reservation == 67108864
- update.diff.after.memory_reservation == 50331648
- >-
(update.diff.before.memory_swap | default(0)) == 67108864 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(update.diff.after.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- "'restart_policy' not in update.diff.before"
- update.diff.before.restart_retries == 5
- update.diff.after.restart_retries == 2
# blkio_weight sometimes cannot be set, then we end up with 0 instead of the value we had
- >-
not has_blkio_weight or update.diff.before.blkio_weight == 123 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or update.diff.after.blkio_weight == 234
- update.diff.before.cpu_period == 90000
- update.diff.after.cpu_period == 50000
- update.diff.before.cpu_quota == 150000
- update.diff.after.cpu_quota == 50000
- update.diff.before.cpu_shares == 900
- update.diff.after.cpu_shares == 1100
- update.diff.before.memory == 67108864
- update.diff.after.memory == 50331648
- update.diff.before.memory_reservation == 67108864
- update.diff.after.memory_reservation == 50331648
- >-
(update.diff.before.memory_swap | default(0)) == 67108864 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(update.diff.after.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- "'restart_policy' not in update.diff.before"
- update.diff.before.restart_retries == 5
- update.diff.after.restart_retries == 2
- name: Check diff for second update
assert:
that:
- >-
not has_blkio_weight or update2.diff.before.blkio_weight == 234 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or update2.diff.after.blkio_weight == 135
- update2.diff.before.cpu_period == 50000
- update2.diff.after.cpu_period == 30000
- update2.diff.before.cpu_quota == 50000
- update2.diff.after.cpu_quota == 40000
- update2.diff.before.cpu_shares == 1100
- update2.diff.after.cpu_shares == 1000
- update2.diff.before.memory == 50331648
- update2.diff.after.memory == 33554432
- update2.diff.before.memory_reservation == 50331648
- update2.diff.after.memory_reservation == 31457280
- >-
(update2.diff.before.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(update2.diff.after.memory_swap | default(0)) == 134217728 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- update2.diff.before.restart_policy == 'on-failure'
- update2.diff.after.restart_policy == 'always'
- update2.diff.before.restart_retries == 2
- update2.diff.after.restart_retries == 0
- >-
not has_blkio_weight or update2.diff.before.blkio_weight == 234 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or update2.diff.after.blkio_weight == 135
- update2.diff.before.cpu_period == 50000
- update2.diff.after.cpu_period == 30000
- update2.diff.before.cpu_quota == 50000
- update2.diff.after.cpu_quota == 40000
- update2.diff.before.cpu_shares == 1100
- update2.diff.after.cpu_shares == 1000
- update2.diff.before.memory == 50331648
- update2.diff.after.memory == 33554432
- update2.diff.before.memory_reservation == 50331648
- update2.diff.after.memory_reservation == 31457280
- >-
(update2.diff.before.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(update2.diff.after.memory_swap | default(0)) == 134217728 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- update2.diff.before.restart_policy == 'on-failure'
- update2.diff.after.restart_policy == 'always'
- update2.diff.before.restart_retries == 2
- update2.diff.after.restart_retries == 0
- name: Check diff for recreation
assert:
that:
- >-
not has_blkio_weight or recreate.diff.before.blkio_weight == 135 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or recreate.diff.after.blkio_weight == 234
- recreate.diff.before.cpu_period == 30000
- recreate.diff.after.cpu_period == 50000
- recreate.diff.before.cpu_quota == 40000
- recreate.diff.after.cpu_quota == 50000
- recreate.diff.before.cpu_shares == 1000
- recreate.diff.after.cpu_shares == 1100
- recreate.diff.before.memory == 33554432
- recreate.diff.after.memory == 50331648
- recreate.diff.before.memory_reservation == 31457280
- recreate.diff.after.memory_reservation == 50331648
- >-
(recreate.diff.before.memory_swap | default(0)) == 134217728 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(recreate.diff.after.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- recreate.diff.before.restart_policy == 'always'
- recreate.diff.after.restart_policy == 'on-failure'
- recreate.diff.before.restart_retries == 0
- recreate.diff.after.restart_retries == 2
- recreate.diff.before.command == ['/bin/sh', '-c', 'sleep 10m']
- recreate.diff.after.command == ['/bin/sh', '-c', 'sleep 20m']
- >-
not has_blkio_weight or recreate.diff.before.blkio_weight == 135 or ('Docker warning: Your kernel does not support Block I/O weight or the cgroup is not mounted. Weight discarded.' in (create.warnings | default([])))
- not has_blkio_weight or recreate.diff.after.blkio_weight == 234
- recreate.diff.before.cpu_period == 30000
- recreate.diff.after.cpu_period == 50000
- recreate.diff.before.cpu_quota == 40000
- recreate.diff.after.cpu_quota == 50000
- recreate.diff.before.cpu_shares == 1000
- recreate.diff.after.cpu_shares == 1100
- recreate.diff.before.memory == 33554432
- recreate.diff.after.memory == 50331648
- recreate.diff.before.memory_reservation == 31457280
- recreate.diff.after.memory_reservation == 50331648
- >-
(recreate.diff.before.memory_swap | default(0)) == 134217728 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- >-
(recreate.diff.after.memory_swap | default(0)) == -1 or ('Docker warning: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.' in (create.warnings | default([])))
- recreate.diff.before.restart_policy == 'always'
- recreate.diff.after.restart_policy == 'on-failure'
- recreate.diff.before.restart_retries == 0
- recreate.diff.after.restart_retries == 2
- recreate.diff.before.command == ['/bin/sh', '-c', 'sleep 10m']
- recreate.diff.after.command == ['/bin/sh', '-c', 'sleep 20m']