mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-12 11:51:10 +00:00
facts: Add linux virtio module detection (#25578)
Detect as kvm guest if virtio linux kernel module is loaded
This commit is contained in:
committed by
Adrian Likins
parent
6bc1e802e3
commit
e7deb07a87
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user