Skip to content

Commit

Permalink
[stable-2.15] facts: Add a generic detection for VMware product name (#…
Browse files Browse the repository at this point in the history
…83109)

* Use startswith instead of hardcoded values in VMWare product
  detction

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde committed May 9, 2024
1 parent 6fe3b64 commit 2e32ada
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/vmware_facts.yml
@@ -0,0 +1,3 @@
---
bugfixes:
- facts - add a generic detection for VMware in product name.
2 changes: 1 addition & 1 deletion lib/ansible/module_utils/facts/virtual/linux.py
Expand Up @@ -176,7 +176,7 @@ def get_virtual_facts(self):
virtual_facts['virtualization_type'] = 'RHEV'
found_virt = True

if product_name in ('VMware Virtual Platform', 'VMware7,1'):
if product_name and product_name.startswith(("VMware",)):
guest_tech.add('VMware')
if not found_virt:
virtual_facts['virtualization_type'] = 'VMware'
Expand Down

0 comments on commit 2e32ada

Please sign in to comment.