mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix new EC2 C5 instance virtualization_type identification (#35063)
* fix new EC2 C5 instance virtualization_type identification Fixes #35051 Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
parent
bda2f42f97
commit
f95adcce8e
1 changed files with 10 additions and 0 deletions
|
@ -114,6 +114,11 @@ class LinuxVirtual(Virtual):
|
|||
virtual_facts['virtualization_role'] = 'guest'
|
||||
return virtual_facts
|
||||
|
||||
if bios_vendor == 'Amazon EC2':
|
||||
virtual_facts['virtualization_type'] = 'kvm'
|
||||
virtual_facts['virtualization_role'] = 'guest'
|
||||
return virtual_facts
|
||||
|
||||
sys_vendor = get_file_content('/sys/devices/virtual/dmi/id/sys_vendor')
|
||||
|
||||
# FIXME: This does also match hyperv
|
||||
|
@ -142,6 +147,11 @@ class LinuxVirtual(Virtual):
|
|||
virtual_facts['virtualization_role'] = 'guest'
|
||||
return virtual_facts
|
||||
|
||||
if sys_vendor == 'Amazon EC2':
|
||||
virtual_facts['virtualization_type'] = 'kvm'
|
||||
virtual_facts['virtualization_role'] = 'guest'
|
||||
return virtual_facts
|
||||
|
||||
if os.path.exists('/proc/self/status'):
|
||||
for line in get_file_lines('/proc/self/status'):
|
||||
if re.match(r'^VxID: \d+', line):
|
||||
|
|
Loading…
Reference in a new issue