1
0
Fork 0
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:
Adam Miller 2018-02-05 11:15:53 -06:00 committed by Adrian Likins
parent bda2f42f97
commit f95adcce8e

View file

@ -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):