From e5190327f2131997cae02e57e0c012e69c1a1828 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Wed, 6 May 2015 22:47:53 +0200 Subject: [PATCH] this fixes ansible on openbsd and freebsd systems. only tested on openbsd. --- lib/ansible/module_utils/facts.py | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 6ddae5df855..7209f699c34 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -2535,6 +2535,43 @@ class LinuxVirtual(Virtual): self.facts['virtualization_role'] = 'NA' return +class FreeBSDVirtual(Virtual): + """ + This is a FreeBSD-specific subclass of Virtual. It defines + - virtualization_type + - virtualization_role + """ + platform = 'FreeBSD' + + def __init__(self): + Virtual.__init__(self) + + def populate(self): + self.get_virtual_facts() + return self.facts + + def get_virtual_facts(self): + self.facts['virtualization_type'] = '' + self.facts['virtualization_role'] = '' + +class OpenBSDVirtual(Virtual): + """ + This is a OpenBSD-specific subclass of Virtual. It defines + - virtualization_type + - virtualization_role + """ + platform = 'OpenBSD' + + def __init__(self): + Virtual.__init__(self) + + def populate(self): + self.get_virtual_facts() + return self.facts + + def get_virtual_facts(self): + self.facts['virtualization_type'] = '' + self.facts['virtualization_role'] = '' class HPUXVirtual(Virtual): """