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 #1542 from arrfab/xen-fact-issue

Fixed the way dom0/domU xen role is defined in the setup module
This commit is contained in:
Michael DeHaan 2012-11-07 04:05:38 -08:00
commit 7cd013f854

View file

@ -711,11 +711,12 @@ class LinuxVirtual(Virtual):
def get_virtual_facts(self):
if os.path.exists("/proc/xen"):
self.facts['virtualization_type'] = 'xen'
self.facts['virtualization_role'] = 'guest'
if os.path.exists('/proc/xen/capabilities'):
self.facts['virtualization_role'] = 'host'
else:
self.facts['virtualization_role'] = 'guest'
for line in open('/proc/xen/capabilities'):
if "control_d" in line:
self.facts['virtualization_role'] = 'host'
elif os.path.exists('/proc/vz'):
self.facts['virtualization_type'] = 'openvz'
if os.path.exists('/proc/vz/version'):