Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/docker_node/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 # Run the tests
12 - block:
13 - ansible.builtin.include_tasks: test_node.yml
14
15 always:
16 - name: Cleanup (trying)
17 community.docker.docker_swarm:
18 state: absent
19 force: true
20 diff: false
21 ignore_errors: true
22
23 - name: Restart docker daemon
24 ansible.builtin.service:
25 name: docker
26 state: restarted
27 become: true
28 - name: Wait for docker daemon to be fully restarted
29 ansible.builtin.command: docker ps
30 ignore_errors: true
31
32 - name: Cleanup
33 community.docker.docker_swarm:
34 state: absent
35 force: true
36 diff: false
37
38 when: docker_py_version is version('2.4.0', '>=') and docker_api_version is version('1.25', '>=')
39
40 - ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_node tests!"
41 when: not(docker_py_version is version('2.4.0', '>=') and docker_api_version is version('1.25', '>=')) and (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int > 6)