Fix docker CI. (#1494)

Backport of ansible-collections/community.docker#50 to stable-1.
This commit is contained in:
Felix Fontein 2020-12-15 20:20:43 +01:00 committed by GitHub
commit 6d4760eb20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 54 additions and 58 deletions

View file

@ -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

View file

@ -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

View file

@ -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