Debian Codegraph @

ansible_collections/community/docker/tests/integration/targets/current_container_facts/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: Get facts
12 community.docker.current_container_facts:
13 register: result
14
15 # WARNING: This is not a proper test as it won't fail when the module does not work!
16 # To make this a proper test, we need to know the environment in which this
17 # test runs, which we do not know in general...
18
19 - name: Print facts
20 ansible.builtin.debug:
21 var: result.ansible_facts
22
23 - name: Read files
24 ansible.builtin.slurp:
25 src: '{{ item }}'
26 loop:
27 - /proc/self/cgroup
28 - /proc/self/cpuset
29 - /proc/self/mountinfo
30 ignore_errors: true # not all of these files always exist
31 register: slurp
32
33 - name: Print files
34 ansible.builtin.debug:
35 msg: |-
36 {{ item.content | ansible.builtin.b64decode | split('
37 ') }}
38 loop: '{{ slurp.results }}'
39 loop_control:
40 label: '{{ item.source | default(item.item) }}'
41 when: item is not failed