From 8278626dd04b52ffe56a8885c4dc1e9f82873d4a Mon Sep 17 00:00:00 2001 From: Jonathan Mainguy Date: Fri, 12 Dec 2014 15:51:47 -0500 Subject: [PATCH] Added distribution facts for OpenSuse --- lib/ansible/module_utils/facts.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 8e27b9b882..7a73a32ffb 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -325,11 +325,15 @@ class Facts(object): if 'suse' in data.lower(): if path == '/etc/os-release': release = re.search("PRETTY_NAME=[^(]+ \(?([^)]+?)\)", data) + distdata = get_file_content(path).split('\n')[0] + self.facts['distribution'] = distdata.split('=')[1] if release: self.facts['distribution_release'] = release.groups()[0] break elif path == '/etc/SuSE-release': data = data.splitlines() + distdata = get_file_content(path).split('\n')[0] + self.facts['distribution'] = distdata.split()[0] for line in data: release = re.search('CODENAME *= *([^\n]+)', line) if release: