diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 2401408140..9118c17067 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -3353,7 +3353,22 @@ class LinuxVirtual(Virtual): modules.append(data[0]) if 'kvm' in modules: - self.facts['virtualization_type'] = 'kvm' + + if os.path.isdir('/rhev/'): + + # Check whether this is a RHEV hypervisor (is vdsm running ?) + for f in glob.glob('/proc/[0-9]*/comm'): + try: + if open(f).read().rstrip() == 'vdsm': + self.facts['virtualization_type'] = 'RHEV' + break + except: + pass + else: + self.facts['virtualization_type'] = 'kvm' + + else: + self.facts['virtualization_type'] = 'kvm' self.facts['virtualization_role'] = 'host' return