diff --git a/changelogs/fragments/64954_virtualization_podman.yml b/changelogs/fragments/64954_virtualization_podman.yml new file mode 100644 index 0000000000..0388fce7cc --- /dev/null +++ b/changelogs/fragments/64954_virtualization_podman.yml @@ -0,0 +1,2 @@ +bugfixes: +- Support virtualization for podman container (https://github.com/ansible/ansible/issues/64954). diff --git a/lib/ansible/module_utils/facts/virtual/linux.py b/lib/ansible/module_utils/facts/virtual/linux.py index 80de32bad4..8add4a1f6c 100644 --- a/lib/ansible/module_utils/facts/virtual/linux.py +++ b/lib/ansible/module_utils/facts/virtual/linux.py @@ -54,6 +54,10 @@ class LinuxVirtual(Virtual): virtual_facts['virtualization_type'] = 'lxc' virtual_facts['virtualization_role'] = 'guest' return virtual_facts + if re.search('container=podman', line): + virtual_facts['virtualization_type'] = 'podman' + virtual_facts['virtualization_role'] = 'guest' + return virtual_facts if os.path.exists('/proc/vz') and not os.path.exists('/proc/lve'): virtual_facts['virtualization_type'] = 'openvz'