From 4c0188a27bf9dff6c70134817048672a00c8eae7 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Tue, 1 Nov 2016 00:11:58 +0100 Subject: [PATCH] On OpenBSD, swap the values for distribution_version and distribution_release --- lib/ansible/module_utils/facts.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index f788ce8634..183b1a82e6 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -764,12 +764,13 @@ class Distribution(object): self.facts['distribution_version'] = '%s.%s' % (data.group(1), data.group(2)) def get_distribution_OpenBSD(self): + self.facts['distribution_version'] = platform.release() rc, out, err = self.module.run_command("/sbin/sysctl -n kern.version") match = re.match('OpenBSD\s[0-9]+.[0-9]+-(\S+)\s.*', out) if match: - self.facts['distribution_version'] = match.groups()[0] + self.facts['distribution_release'] = match.groups()[0] else: - self.facts['distribution_version'] = 'release' + self.facts['distribution_release'] = 'release' def get_distribution_DragonFly(self): pass