From 2e82989b3bd0c6b8e124c8d769e5a0210cb5c086 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 10 Dec 2019 11:26:34 +0530 Subject: [PATCH] Add support for podman in virtualization facts (#64981) Check additional file check virtualization facts for podman Fixes: #64954 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/64954_virtualization_podman.yml | 2 ++ lib/ansible/module_utils/facts/virtual/linux.py | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/64954_virtualization_podman.yml 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'