Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for clearlinux showing release number #47101

Merged
merged 1 commit into from
Nov 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/ansible/module_utils/facts/system/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class DistributionFiles:
'OracleLinux': 'Oracle Linux',
'RedHat': 'Red Hat',
'Altlinux': 'ALT',
'ClearLinux': 'Clear Linux',
'SMGL': 'Source Mage GNU/Linux',
}

Expand Down Expand Up @@ -375,6 +374,20 @@ def parse_distribution_file_Coreos(self, name, data, path, collected_facts):

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):
"""
Expand Down