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:
parent
6bc1e802e3
commit
e7deb07a87
1 changed files with 5 additions and 0 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue