1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Check if CPU is QEMU via different mechanism

The processor fact doesn't exist in LinuxVirtual.  Read /proc/cpuinfo
and check if it is QEMU.
This commit is contained in:
Stephen Fromm 2012-07-18 16:41:55 -07:00
parent e3dd25b1b2
commit 162b78ea5c

View file

@ -546,7 +546,8 @@ class LinuxVirtual(Virtual):
elif 'vboxguest' in modules:
self.facts['virtualization_type'] = 'virtualbox'
self.facts['virtualization_role'] = 'guest'
if 'processor' in self.facts and 'QEMU' in self.facts['processor'][0]:
data = get_file_content('/proc/cpuinfo')
if 'QEMU' in data:
self.facts['virtualization_type'] = 'kvm'
self.facts['virtualization_role'] = 'guest'
if 'distribution' in self.facts and self.facts['distribution'] == 'VMwareESX':