1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #9382 from gquintard/WIP/newdockerdetection

Detect docker as virtualization_type
This commit is contained in:
James Cammarata 2014-10-20 11:20:34 -05:00
commit 28fd4df787

View file

@ -2159,6 +2159,10 @@ class LinuxVirtual(Virtual):
if os.path.exists('/proc/1/cgroup'):
for line in open('/proc/1/cgroup').readlines():
if re.search('/docker/', line):
self.facts['virtualization_type'] = 'docker'
self.facts['virtualization_role'] = 'guest'
return
if re.search('/lxc/', line):
self.facts['virtualization_type'] = 'lxc'
self.facts['virtualization_role'] = 'guest'