Adding check to ensure 'container' get's added to guest_tech when appropriate (#71385)

This commit is contained in:
Carlos Matos 2020-09-28 15:21:44 -04:00 committed by GitHub
parent 94522b7c10
commit cbd3df369f
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 @@
minor_changes:
- linux facts - Add additional check to ensure 'container' virtual fact gets added to guest_tech when appropriate (https://github.com/ansible/ansible/pull/71385)

View file

@ -104,6 +104,10 @@ class LinuxVirtual(Virtual):
virtual_facts['virtualization_role'] = 'guest'
found_virt = True
# ensure 'container' guest_tech is appropriately set
if guest_tech.intersection(set(['docker', 'lxc', 'podman', 'openvz'])) or systemd_container:
guest_tech.add('container')
if os.path.exists("/proc/xen"):
is_xen_host = False
try: