From 12354869b9937eaceb027146f6b82db544154236 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 6 Nov 2016 12:27:45 +0100 Subject: [PATCH] Add xen guest detection on FreeBSD --- lib/ansible/module_utils/facts.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 4275802980..d673783bbb 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -3325,6 +3325,16 @@ class FreeBSDVirtual(Virtual): """ platform = 'FreeBSD' + def get_virtual_facts(self): + + # Set empty values as default + self.facts['virtualization_type'] = '' + self.facts['virtualization_role'] = '' + + if os.path.exists('/dev/xen/xenstore'): + self.facts['virtualization_type'] = 'xen' + self.facts['virtualization_role'] = 'guest' + class DragonFlyVirtual(FreeBSDVirtual): platform = 'DragonFly'