mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Merge branch 'devel' of https://github.com/drybjed/ansible into drybjed-devel
This commit is contained in:
@@ -1904,6 +1904,13 @@ class LinuxVirtual(Virtual):
|
|||||||
self.facts['virtualization_role'] = 'guest'
|
self.facts['virtualization_role'] = 'guest'
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if os.path.exists('/proc/1/cgroup'):
|
||||||
|
for line in open('/proc/1/cgroup').readlines():
|
||||||
|
if re.search('/lxc/', line):
|
||||||
|
self.facts['virtualization_type'] = 'lxc'
|
||||||
|
self.facts['virtualization_role'] = 'guest'
|
||||||
|
return
|
||||||
|
|
||||||
product_name = get_file_content('/sys/devices/virtual/dmi/id/product_name')
|
product_name = get_file_content('/sys/devices/virtual/dmi/id/product_name')
|
||||||
|
|
||||||
if product_name in ['KVM', 'Bochs']:
|
if product_name in ['KVM', 'Bochs']:
|
||||||
|
|||||||
Reference in New Issue
Block a user