Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/docker_image_push/tasks/test.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Create random name prefix
7 ansible.builtin.set_fact:
8 name_prefix: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
9 - name: Create image and container list
10 ansible.builtin.set_fact:
11 inames: []
12 cnames: []
13
14 - ansible.builtin.debug:
15 msg: "Using name prefix {{ name_prefix }}"
16
17 - block:
18 - ansible.builtin.include_tasks: run-test.yml
19 with_fileglob:
20 - "tests/*.yml"
21 loop_control:
22 loop_var: test_name
23
24 always:
25 - name: "Make sure all images are removed"
26 community.docker.docker_image_remove:
27 name: "{{ item }}"
28 with_items: "{{ inames }}"
29 - name: "Make sure all containers are removed"
30 community.docker.docker_container:
31 name: "{{ item }}"
32 state: absent
33 force_kill: true
34 with_items: "{{ cnames }}"
35
36 when: docker_api_version is version('1.25', '>=')
37
38 - ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_image tests!"
39 when: not(docker_api_version is version('1.25', '>=')) and (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int > 6)