diff --git a/tests/integration/targets/docker_container/tasks/tests/image-ids.yml b/tests/integration/targets/docker_container/tasks/tests/image-ids.yml index cd1a739d62..ff4a97a703 100644 --- a/tests/integration/targets/docker_container/tasks/tests/image-ids.yml +++ b/tests/integration/targets/docker_container/tasks/tests/image-ids.yml @@ -11,7 +11,7 @@ name: "{{ image }}" source: pull loop: - - "{{ docker_test_image_hello_world }}:latest" + - "{{ docker_test_image_hello_world }}" - "{{ docker_test_image_alpine }}" loop_control: loop_var: image @@ -19,7 +19,7 @@ - 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 }}:latest" + - "{{ docker_test_image_hello_world }}" - "{{ docker_test_image_alpine }}" register: image_info @@ -103,25 +103,25 @@ - create_6.container.Image == image_info.images[1].Id - create_6.container.Id == create_4.container.Id # make sure container wasn't recreated -- name: Create container with {{ docker_test_image_hello_world }} image via old digest +- name: Create container with {{ docker_test_image_digest_base }} image via old digest docker_container: - image: "{{ docker_test_image_hello_world }}@sha256:{{ docker_test_image_hello_world_digest_v1 }}" + image: "{{ docker_test_image_digest_base }}@sha256:{{ docker_test_image_digest_v1 }}" name: "{{ cname }}" state: present force_kill: yes register: digest_1 -- name: Create container with {{ docker_test_image_hello_world }} image via old digest (idempotent) +- name: Create container with {{ docker_test_image_digest_base }} image via old digest (idempotent) docker_container: - image: "{{ docker_test_image_hello_world }}@sha256:{{ docker_test_image_hello_world_digest_v1 }}" + image: "{{ docker_test_image_digest_base }}@sha256:{{ docker_test_image_digest_v1 }}" name: "{{ cname }}" state: present force_kill: yes register: digest_2 -- name: Update container with {{ docker_test_image_hello_world }} image via new digest +- name: Update container with {{ docker_test_image_digest_base }} image via new digest docker_container: - image: "{{ docker_test_image_hello_world }}@sha256:{{ docker_test_image_hello_world_digest_v2 }}" + image: "{{ docker_test_image_digest_base }}@sha256:{{ docker_test_image_digest_v2 }}" name: "{{ cname }}" state: present force_kill: yes diff --git a/tests/integration/targets/docker_container/tasks/tests/options.yml b/tests/integration/targets/docker_container/tasks/tests/options.yml index 40b4fda093..79c329143e 100644 --- a/tests/integration/targets/docker_container/tasks/tests/options.yml +++ b/tests/integration/targets/docker_container/tasks/tests/options.yml @@ -587,12 +587,6 @@ # of hello-world. We don't know why this happens, but it happens # often enough to be annoying. That's why we disable this for now, # and simply test that 'Output' is contained in the result. - # NOTE {{ docker_test_image_hello_world }} is no longer necessarily the - # hello-world image, so we potentially have a different output - # anyway. If someone wants to revive this test, it's probably best - # to keep {{ docker_test_image_hello_world }} as some image that - # has 'echo' and execute 'echo "Hello from Docker!"' or something - # like that. - "'Output' in detach_no_cleanup.container" # - "'Hello from Docker!' in detach_no_cleanup.container.Output" - detach_no_cleanup_cleanup is changed diff --git a/tests/integration/targets/docker_image/tasks/tests/basic.yml b/tests/integration/targets/docker_image/tasks/tests/basic.yml index 91932672fc..23a0e14887 100644 --- a/tests/integration/targets/docker_image/tasks/tests/basic.yml +++ b/tests/integration/targets/docker_image/tasks/tests/basic.yml @@ -5,14 +5,14 @@ - name: Make sure image is not there docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" state: absent force_absent: yes register: absent_1 - name: Make sure image is not there (idempotency) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" state: absent register: absent_2 @@ -22,14 +22,14 @@ - name: Make sure image is there docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" state: present source: pull register: present_1 - name: Make sure image is there (idempotent) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" state: present source: pull register: present_2 @@ -41,28 +41,28 @@ - name: Make sure tag is not there docker_image: - name: "{{ docker_test_image_hello_world }}:alias" + name: "{{ docker_test_image_hello_world_base }}:alias" state: absent - name: Tag image with alias docker_image: source: local - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ docker_test_image_hello_world }}:alias" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ docker_test_image_hello_world_base }}:alias" register: tag_1 - name: Tag image with alias (idempotent) docker_image: source: local - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ docker_test_image_hello_world }}:alias" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ docker_test_image_hello_world_base }}:alias" register: tag_2 - name: Tag image with alias (force, still idempotent) docker_image: source: local - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ docker_test_image_hello_world }}:alias" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ docker_test_image_hello_world_base }}:alias" force_tag: yes register: tag_3 @@ -74,5 +74,5 @@ - name: Cleanup alias tag docker_image: - name: "{{ docker_test_image_hello_world }}:alias" + name: "{{ docker_test_image_hello_world_base }}:alias" state: absent diff --git a/tests/integration/targets/docker_image/tasks/tests/docker_image.yml b/tests/integration/targets/docker_image/tasks/tests/docker_image.yml index 9f5b20c74f..c00553bc77 100644 --- a/tests/integration/targets/docker_image/tasks/tests/docker_image.yml +++ b/tests/integration/targets/docker_image/tasks/tests/docker_image.yml @@ -22,31 +22,31 @@ state: absent force_absent: yes -- name: Make sure we have {{ docker_test_image_hello_world }}:latest +- name: Make sure we have {{ docker_test_image_hello_world }} docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" source: pull - name: Push image to test registry docker_image: - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ hello_world_image_base }}" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ hello_world_image_base }}:latest" push: yes source: local register: push_1 - name: Push image to test registry (idempotent) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ hello_world_image_base }}" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ hello_world_image_base }}:latest" push: yes source: local register: push_2 - name: Push image to test registry (force, still idempotent) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" - repository: "{{ hello_world_image_base }}" + name: "{{ docker_test_image_hello_world }}" + repository: "{{ hello_world_image_base }}:latest" push: yes source: local force_tag: yes diff --git a/tests/integration/targets/docker_image/tasks/tests/options.yml b/tests/integration/targets/docker_image/tasks/tests/options.yml index e308bb1a03..b04fa8ea4e 100644 --- a/tests/integration/targets/docker_image/tasks/tests/options.yml +++ b/tests/integration/targets/docker_image/tasks/tests/options.yml @@ -184,27 +184,27 @@ - name: Archive image docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" archive_path: "{{ output_dir }}/image.tar" source: pull register: archive_image - name: remove image docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" state: absent force_absent: yes - name: load image (changed) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" load_path: "{{ output_dir }}/image.tar" source: load register: load_image - name: load image (idempotency) docker_image: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" load_path: "{{ output_dir }}/image.tar" source: load register: load_image_1 diff --git a/tests/integration/targets/docker_image_info/tasks/main.yml b/tests/integration/targets/docker_image_info/tasks/main.yml index cf07116a92..8b510c9c0b 100644 --- a/tests/integration/targets/docker_image_info/tasks/main.yml +++ b/tests/integration/targets/docker_image_info/tasks/main.yml @@ -25,23 +25,23 @@ source: pull state: present loop: - - "{{ docker_test_image_hello_world }}:latest" + - "{{ docker_test_image_hello_world }}" - "{{ docker_test_image_alpine }}" - name: Inspect an available image docker_image_info: - name: "{{ docker_test_image_hello_world }}:latest" + name: "{{ docker_test_image_hello_world }}" register: result - assert: that: - "result.images|length == 1" - - "(docker_test_image_hello_world ~ ':latest') in result.images[0].RepoTags" + - "docker_test_image_hello_world in result.images[0].RepoTags" - name: Inspect multiple images docker_image_info: name: - - "{{ docker_test_image_hello_world }}:latest" + - "{{ docker_test_image_hello_world }}" - "{{ docker_test_image_alpine }}" register: result @@ -50,7 +50,7 @@ - assert: that: - "result.images|length == 2" - - "(docker_test_image_hello_world ~ ':latest') in result.images[0].RepoTags" + - "docker_test_image_hello_world in result.images[0].RepoTags" - "docker_test_image_alpine in result.images[1].RepoTags" when: docker_py_version is version('1.8.0', '>=') and docker_api_version is version('1.20', '>=') diff --git a/tests/integration/targets/docker_stack/templates/stack_compose_base.yml b/tests/integration/targets/docker_stack/templates/stack_compose_base.yml index a0a33c4314..b5162d68df 100644 --- a/tests/integration/targets/docker_stack/templates/stack_compose_base.yml +++ b/tests/integration/targets/docker_stack/templates/stack_compose_base.yml @@ -1,5 +1,5 @@ version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 diff --git a/tests/integration/targets/docker_stack/vars/main.yml b/tests/integration/targets/docker_stack/vars/main.yml index b6f1cf1649..7751c86eac 100644 --- a/tests/integration/targets/docker_stack/vars/main.yml +++ b/tests/integration/targets/docker_stack/vars/main.yml @@ -2,7 +2,7 @@ stack_compose_base: version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 stack_compose_overrides: diff --git a/tests/integration/targets/docker_stack_info/templates/stack_compose_base.yml b/tests/integration/targets/docker_stack_info/templates/stack_compose_base.yml index a0a33c4314..b5162d68df 100644 --- a/tests/integration/targets/docker_stack_info/templates/stack_compose_base.yml +++ b/tests/integration/targets/docker_stack_info/templates/stack_compose_base.yml @@ -1,5 +1,5 @@ version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 diff --git a/tests/integration/targets/docker_stack_info/vars/main.yml b/tests/integration/targets/docker_stack_info/vars/main.yml index b6f1cf1649..7751c86eac 100644 --- a/tests/integration/targets/docker_stack_info/vars/main.yml +++ b/tests/integration/targets/docker_stack_info/vars/main.yml @@ -2,7 +2,7 @@ stack_compose_base: version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 stack_compose_overrides: 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 741cce68e5..88e9eca358 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 @@ -74,7 +74,7 @@ that: - 'output.results | type_debug == "list"' - 'output.results[0].DesiredState == "Running"' - - 'output.results[0].Image == docker_test_image_busybox ~ ":latest"' + - 'output.results[0].Image == docker_test_image_busybox' - 'output.results[0].Name == "test_stack_busybox.1"' always: diff --git a/tests/integration/targets/docker_stack_task_info/templates/stack_compose_base.yml b/tests/integration/targets/docker_stack_task_info/templates/stack_compose_base.yml index a0a33c4314..b5162d68df 100644 --- a/tests/integration/targets/docker_stack_task_info/templates/stack_compose_base.yml +++ b/tests/integration/targets/docker_stack_task_info/templates/stack_compose_base.yml @@ -1,5 +1,5 @@ version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 diff --git a/tests/integration/targets/docker_stack_task_info/vars/main.yml b/tests/integration/targets/docker_stack_task_info/vars/main.yml index b6f1cf1649..7751c86eac 100644 --- a/tests/integration/targets/docker_stack_task_info/vars/main.yml +++ b/tests/integration/targets/docker_stack_task_info/vars/main.yml @@ -2,7 +2,7 @@ stack_compose_base: version: '3' services: busybox: - image: "{{ docker_test_image_busybox }}:latest" + image: "{{ docker_test_image_busybox }}" command: sleep 3600 stack_compose_overrides: diff --git a/tests/integration/targets/inventory_docker_machine/playbooks/test_inventory_1.yml b/tests/integration/targets/inventory_docker_machine/playbooks/test_inventory_1.yml index 476262f1ab..f76f01c251 100644 --- a/tests/integration/targets/inventory_docker_machine/playbooks/test_inventory_1.yml +++ b/tests/integration/targets/inventory_docker_machine/playbooks/test_inventory_1.yml @@ -47,4 +47,4 @@ - name: run a Docker container on the target Docker Machine host to verify that Docker daemon connection settings from the docker-machine inventory plugin work as expected docker_container: name: test - image: hello-world:latest \ No newline at end of file + image: hello-world:latest diff --git a/tests/integration/targets/setup_docker/vars/main.yml b/tests/integration/targets/setup_docker/vars/main.yml index 525c42fed3..8d4b74c5f1 100644 --- a/tests/integration/targets/setup_docker/vars/main.yml +++ b/tests/integration/targets/setup_docker/vars/main.yml @@ -1,9 +1,11 @@ --- -docker_test_image_hello_world_digest_v1: e004c2cc521c95383aebb1fb5893719aa7a8eae2e7a71f316a4410784edb00a9 -docker_test_image_hello_world_digest_v2: c9249fdf56138f0d929e2080ae98ee9cb2946f71498fc1484288e6a935b5e5bc -docker_test_image_hello_world: quay.io/app-sre/busybox -docker_test_image_busybox: quay.io/app-sre/busybox -docker_test_image_alpine: quay.io/app-sre/alpine:3.8 -docker_test_image_alpine_different: quay.io/app-sre/alpine:3.7 -docker_test_image_registry_nginx: nginx:alpine +docker_test_image_digest_v1: e004c2cc521c95383aebb1fb5893719aa7a8eae2e7a71f316a4410784edb00a9 +docker_test_image_digest_v2: ee44b399df993016003bf5466bd3eeb221305e9d0fa831606bc7902d149c775b +docker_test_image_digest_base: quay.io/ansible/docker-test-containers +docker_test_image_hello_world: quay.io/ansible/docker-test-containers:hello-world +docker_test_image_hello_world_base: quay.io/ansible/docker-test-containers +docker_test_image_busybox: quay.io/ansible/docker-test-containers:busybox +docker_test_image_alpine: quay.io/ansible/docker-test-containers:alpine3.8 +docker_test_image_alpine_different: quay.io/ansible/docker-test-containers:alpine3.7 +docker_test_image_registry_nginx: quay.io/ansible/docker-test-containers:nginx-alpine docker_test_image_registry: registry:2.6.1