diff --git a/lib/ansible/module_utils/facts/virtual/linux.py b/lib/ansible/module_utils/facts/virtual/linux.py index 0320c560fa..a2b41b30b6 100644 --- a/lib/ansible/module_utils/facts/virtual/linux.py +++ b/lib/ansible/module_utils/facts/virtual/linux.py @@ -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):