mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07: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'
|
virtual_facts['virtualization_role'] = 'host'
|
||||||
return virtual_facts
|
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
|
# If none of the above matches, return 'NA' for virtualization_type
|
||||||
# and virtualization_role. This allows for proper grouping.
|
# and virtualization_role. This allows for proper grouping.
|
||||||
virtual_facts['virtualization_type'] = 'NA'
|
virtual_facts['virtualization_type'] = 'NA'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue