Debian Codegraph @

ansible_collections/community/docker/tests/ee/roles/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 - name: Retrieve information on current container
7 community.docker.current_container_facts:
8 register: result
9
10 - name: Print facts returned by module
11 ansible.builtin.debug:
12 var: result.ansible_facts
13
14 # The following two tasks are useful if we ever have to debug why this fails.
15
16 - name: Print all Ansible facts
17 ansible.builtin.debug:
18 var: ansible_facts
19
20 - name: Read some files
21 ansible.builtin.slurp:
22 src: "{{ path }}"
23 loop:
24 - /proc/self/cpuset
25 - /proc/1/cgroup
26 - /proc/1/environ
27 ignore_errors: true # not all of these files always exist
28 loop_control:
29 loop_var: path
30
31 - name: Validate results
32 ansible.builtin.assert:
33 that:
34 - ansible_module_running_in_container
35 - ansible_module_container_type != ''