facts: set virtualization_role for KVM hosts (#50770)

* facts: set virtualization_role for KVM hosts

Fixes #49734

* Add changelog
pull/50728/head
Martin Krizek 6 years ago committed by GitHub
parent f06474ae4f
commit 3b42b1796c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- facts - set virtualization_role for KVM hosts (https://github.com/ansible/ansible/issues/49734)

@ -189,9 +189,10 @@ class LinuxVirtual(Virtual):
modules.append(data[0])
if 'kvm' in modules:
virtual_facts['virtualization_type'] = 'kvm'
virtual_facts['virtualization_role'] = 'host'
if os.path.isdir('/rhev/'):
# Check whether this is a RHEV hypervisor (is vdsm running ?)
for f in glob.glob('/proc/[0-9]*/comm'):
try:
@ -202,12 +203,6 @@ class LinuxVirtual(Virtual):
break
except Exception:
pass
else:
virtual_facts['virtualization_type'] = 'kvm'
else:
virtual_facts['virtualization_type'] = 'kvm'
virtual_facts['virtualization_role'] = 'host'
return virtual_facts

Loading…
Cancel
Save