Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/docker_volume/tasks/main.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 ####################################################################
7 # WARNING: These are designed specifically for Ansible tests #
8 # and should not be used as examples of how to write Ansible roles #
9 ####################################################################
10
11 - name: Create random name prefix
12 ansible.builtin.set_fact:
13 name_prefix: "{{ 'ansible-docker-test-%0x' % ((2**32) | random) }}"
14 vnames: []
15
16 - ansible.builtin.debug:
17 msg: "Using name prefix {{ name_prefix }}"
18
19 - block:
20 - ansible.builtin.include_tasks: run-test.yml
21 with_fileglob:
22 - "tests/*.yml"
23 loop_control:
24 loop_var: test_name
25
26 always:
27 - name: "Make sure all volumes are removed"
28 community.docker.docker_volume:
29 name: "{{ item }}"
30 state: absent
31 with_items: "{{ vnames }}"
32
33 when: docker_api_version is version('1.25', '>=')
34
35 - ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_volume tests!"
36 when: not(docker_api_version is version('1.25', '>=')) and (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int > 6)