mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-05 15:59:09 -07:00
parent
b9442b2468
commit
3bc6228b97
1 changed files with 3 additions and 1 deletions
|
@ -713,10 +713,12 @@ class LinuxVirtual(Virtual):
|
||||||
if os.path.exists("/proc/xen"):
|
if os.path.exists("/proc/xen"):
|
||||||
self.facts['virtualization_type'] = 'xen'
|
self.facts['virtualization_type'] = 'xen'
|
||||||
self.facts['virtualization_role'] = 'guest'
|
self.facts['virtualization_role'] = 'guest'
|
||||||
if os.path.exists('/proc/xen/capabilities'):
|
try:
|
||||||
for line in open('/proc/xen/capabilities'):
|
for line in open('/proc/xen/capabilities'):
|
||||||
if "control_d" in line:
|
if "control_d" in line:
|
||||||
self.facts['virtualization_role'] = 'host'
|
self.facts['virtualization_role'] = 'host'
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
return
|
return
|
||||||
|
|
||||||
if os.path.exists('/proc/vz'):
|
if os.path.exists('/proc/vz'):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue