mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 20:08:41 +00:00
* Make current_container_facts work with newer Docker versions and latest ansible-test container changes (#510)
* Add more debug output.
* Add basic integration test.
* Split into lines.
* Fix docker detection, add podman detection.
ci_complete
* Improve regular expression.
* Document that this module is trying its best, but might not be perfect.
* Update comment.
(cherry picked from commit c2d84efccb)
* Remove new feature (podman support).
42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
---
|
|
# Copyright (c) Ansible Project
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
####################################################################
|
|
# WARNING: These are designed specifically for Ansible tests #
|
|
# and should not be used as examples of how to write Ansible roles #
|
|
####################################################################
|
|
|
|
- name: Get facts
|
|
current_container_facts:
|
|
register: result
|
|
|
|
# WARNING: This is not a proper test as it won't fail when the module does not work!
|
|
# To make this a proper test, we need to know the environment in which this
|
|
# test runs, which we do not know in general...
|
|
|
|
- name: Print facts
|
|
ansible.builtin.debug:
|
|
var: result.ansible_facts
|
|
|
|
- name: Read files
|
|
ansible.builtin.slurp:
|
|
src: '{{ item }}'
|
|
loop:
|
|
- /proc/self/cgroup
|
|
- /proc/self/cpuset
|
|
- /proc/self/mountinfo
|
|
register: slurp
|
|
ignore_errors: true
|
|
|
|
- name: Print files
|
|
ansible.builtin.debug:
|
|
msg: |-
|
|
{{ item.content | ansible.builtin.b64decode | split('
|
|
') }}
|
|
loop: '{{ slurp.results }}'
|
|
loop_control:
|
|
label: '{{ item.source | default(item.item) }}'
|
|
when: item is not failed
|