Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/docker_host_info/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 - ansible.builtin.include_tasks: test_host_info.yml
12 when: docker_api_version is version('1.25', '>=')
13
14 - ansible.builtin.fail: msg="Too old docker / docker-py version to run docker_host_info tests!"
15 when: not(docker_api_version is version('1.25', '>=')) and (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int > 6)
16
17 - when: podman_cli_version is version('1.0.0', '>=')
18 block:
19 - name: Get Podman context
20 community.docker.docker_context_info:
21 name: podman
22 register: docker_podman_context
23
24 - name: Run tests with Podman context
25 module_defaults:
26 group/community.docker.docker: "{{ docker_podman_context.contexts[0].config }}"
27 block:
28
29 - name: Get info on Podman host
30 community.docker.docker_host_info:
31 register: output
32
33 - name: Check for some Podman specific values
34 ansible.builtin.assert:
35 that:
36 - output.host_info.ProductLicense == 'Apache-2.0'
37 - >-
38 "Rootless" in output.host_info