Add support for podman in virtualization facts (#64981)

Check additional file check virtualization facts for podman

Fixes: #64954

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2019-12-10 11:26:34 +05:30 committed by GitHub
parent f8216db21f
commit 2e82989b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Support virtualization for podman container (https://github.com/ansible/ansible/issues/64954).

View file

@ -54,6 +54,10 @@ class LinuxVirtual(Virtual):
virtual_facts['virtualization_type'] = 'lxc' virtual_facts['virtualization_type'] = 'lxc'
virtual_facts['virtualization_role'] = 'guest' virtual_facts['virtualization_role'] = 'guest'
return virtual_facts 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'): if os.path.exists('/proc/vz') and not os.path.exists('/proc/lve'):
virtual_facts['virtualization_type'] = 'openvz' virtual_facts['virtualization_type'] = 'openvz'