diff --git a/changelogs/fragments/distribution_support.yaml b/changelogs/fragments/distribution_support.yaml new file mode 100644 index 0000000000..9728f15559 --- /dev/null +++ b/changelogs/fragments/distribution_support.yaml @@ -0,0 +1,3 @@ +minor_changes: +- Support for Linux Mint 18.3 added in setup facts (https://github.com/ansible/ansible/pull/52224). +- Support for Cumulus Linux 2.5.4 and 3.7.3 added in setup facts (https://github.com/ansible/ansible/pull/52309). diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index b20233e0a3..5ef121ca5d 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -345,6 +345,12 @@ class DistributionFiles: release = re.search(r'VERSION="(.*)"', data) if release: debian_facts['distribution_release'] = release.groups()[0] + elif "Mint" in data: + debian_facts['distribution'] = 'Linux Mint' + version = re.search(r"VERSION_ID=\"(.*)\"", data) + if version: + debian_facts['distribution_version'] = version.group(1) + debian_facts['distribution_major_version'] = version.group(1).split('.')[0] else: return False, debian_facts diff --git a/test/units/module_utils/test_distribution_version.py b/test/units/module_utils/test_distribution_version.py index f12b80551e..2fe548b8e1 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -1157,6 +1157,24 @@ SUPPORT_URL="http://support.cumulusnetworks.com/" 'distribution_version': '2.5.4', } }, + { + "platform.dist": [ + "LinuxMint", + "18.3", + "sylvia", + ], + "input": { + "/etc/os-release": "NAME=\"Linux Mint\"\nVERSION=\"18.3 (Sylvia)\"\nID=linuxmint\nID_LIKE=ubuntu\nPRETTY_NAME=\"Linux Mint 18.3\"\nVERSION_ID=\"18.3\"\nHOME_URL=\"http://www.linuxmint.com/\"\nSUPPORT_URL=\"http://forums.linuxmint.com/\"\nBUG_REPORT_URL=\"http://bugs.launchpad.net/linuxmint/\"\nVERSION_CODENAME=sylvia\nUBUNTU_CODENAME=xenial", # noqa + }, + "name": "Linux Mint 18.3", + "result": { + "distribution_release": "sylvia", + "distribution": "Linux Mint", + "distribution_major_version": "18", + "os_family": "Debian", + "distribution_version": "18.3" + } + } ]