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

facts: Add linux virtio module detection (#25578)

Detect as kvm guest if virtio linux kernel module is loaded
This commit is contained in:
Tomas Dobrovolny 2017-06-16 18:06:56 +02:00 committed by Adrian Likins
parent 6bc1e802e3
commit e7deb07a87

View file

@ -215,6 +215,11 @@ class LinuxVirtual(Virtual):
virtual_facts['virtualization_role'] = 'host'
return virtual_facts
if 'virtio' in modules:
virtual_facts['virtualization_type'] = 'kvm'
virtual_facts['virtualization_role'] = 'guest'
return virtual_facts
# If none of the above matches, return 'NA' for virtualization_type
# and virtualization_role. This allows for proper grouping.
virtual_facts['virtualization_type'] = 'NA'