From 35e02293d531ebd391159b60a1e3a0703adf5f8f Mon Sep 17 00:00:00 2001 From: Josue David Hernandez Date: Fri, 23 Nov 2018 13:22:45 -0600 Subject: [PATCH] Adding support for clearlinux showing release nuber (#47101) Signed-off-by: Josue David Hernandez (cherry picked from commit 8880c726823e4ed3e30249a6f502b91f1bea6d5c) --- .../module_utils/facts/system/distribution.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index 5a08835bee0..556b0a0eccf 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -83,7 +83,6 @@ class DistributionFiles: 'OracleLinux': 'Oracle Linux', 'RedHat': 'Red Hat', 'Altlinux': 'ALT', - 'ClearLinux': 'Clear Linux', 'SMGL': 'Source Mage GNU/Linux', } @@ -375,6 +374,20 @@ class DistributionFiles: return True, coreos_facts + def parse_distribution_file_ClearLinux(self, name, data, path, collected_facts): + clear_facts = {} + if "clearlinux" not in name.lower(): + return False, clear_facts + + version = re.search('VERSION_ID=(.*)', data) + if version: + clear_facts['distribution_major_version'] = version.groups()[0] + clear_facts['distribution_version'] = version.groups()[0] + release = re.search('ID=(.*)', data) + if release: + clear_facts['distribution_release'] = release.groups()[0] + return True, clear_facts + class Distribution(object): """