mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
facts: set virtualization_role for KVM hosts (#50770)
* facts: set virtualization_role for KVM hosts Fixes #49734 * Add changelog
This commit is contained in:
parent
f06474ae4f
commit
3b42b1796c
2 changed files with 4 additions and 7 deletions
|
@ -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])
|
modules.append(data[0])
|
||||||
|
|
||||||
if 'kvm' in modules:
|
if 'kvm' in modules:
|
||||||
|
virtual_facts['virtualization_type'] = 'kvm'
|
||||||
|
virtual_facts['virtualization_role'] = 'host'
|
||||||
|
|
||||||
if os.path.isdir('/rhev/'):
|
if os.path.isdir('/rhev/'):
|
||||||
|
|
||||||
# Check whether this is a RHEV hypervisor (is vdsm running ?)
|
# Check whether this is a RHEV hypervisor (is vdsm running ?)
|
||||||
for f in glob.glob('/proc/[0-9]*/comm'):
|
for f in glob.glob('/proc/[0-9]*/comm'):
|
||||||
try:
|
try:
|
||||||
|
@ -202,12 +203,6 @@ class LinuxVirtual(Virtual):
|
||||||
break
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
|
||||||
virtual_facts['virtualization_type'] = 'kvm'
|
|
||||||
|
|
||||||
else:
|
|
||||||
virtual_facts['virtualization_type'] = 'kvm'
|
|
||||||
virtual_facts['virtualization_role'] = 'host'
|
|
||||||
|
|
||||||
return virtual_facts
|
return virtual_facts
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue