From 5ccbe612587e7d926e3b92f9af2651bc4ae0f60c Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 30 Aug 2017 18:25:57 +0200 Subject: [PATCH] Fix ansible_virtualization_role fact on CloudLinux (#27191) CloudLinux and OpenVZ have common roots, but CloudLinux does not really provide OS virtualization so it should not be regarded as a 'openvz' system. This change adds a check for the existance of the LVE kernel module which only exists on CloudLinux. Fixes: https://github.com/ansible/ansible/issues/26424 --- lib/ansible/module_utils/facts/virtual/linux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts/virtual/linux.py b/lib/ansible/module_utils/facts/virtual/linux.py index ee5f17436e..9ce9132078 100644 --- a/lib/ansible/module_utils/facts/virtual/linux.py +++ b/lib/ansible/module_utils/facts/virtual/linux.py @@ -55,7 +55,7 @@ class LinuxVirtual(Virtual): virtual_facts['virtualization_role'] = 'guest' return virtual_facts - if os.path.exists('/proc/vz'): + if os.path.exists('/proc/vz') and not os.path.exists('/proc/lve'): virtual_facts['virtualization_type'] = 'openvz' if os.path.exists('/proc/bc'): virtual_facts['virtualization_role'] = 'host'