From abe68d523ced3c179f58d330df996e49e2f022c9 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 10 Aug 2018 15:16:33 -0400 Subject: [PATCH] fix alt linux detection for new versions (#43723) they dropped the Linux so now it only shows as ALT, it should still be backwards compatible pkg_mgr detection relies on `Altlinux` string, so properly setting os_distribution should take care of it as side effect fixes #43539 --- changelogs/fragments/alternative_facts.yml | 2 ++ lib/ansible/module_utils/facts/system/distribution.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/alternative_facts.yml diff --git a/changelogs/fragments/alternative_facts.yml b/changelogs/fragments/alternative_facts.yml new file mode 100644 index 0000000000..f24333c4f1 --- /dev/null +++ b/changelogs/fragments/alternative_facts.yml @@ -0,0 +1,2 @@ +bugfixes: + - Fix alt linux detection/matching diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index a0f388393e..3cf6763fc6 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -57,6 +57,7 @@ class DistributionFiles: # - have a function get_distribution_DISTNAME implemented # keep names in sync with Conditionals page of docs OSDIST_LIST = ( + {'path': '/etc/altlinux-release', 'name': 'Altlinux'}, {'path': '/etc/oracle-release', 'name': 'OracleLinux'}, {'path': '/etc/slackware-version', 'name': 'Slackware'}, {'path': '/etc/redhat-release', 'name': 'RedHat'}, @@ -72,7 +73,6 @@ class DistributionFiles: {'path': '/etc/os-release', 'name': 'Debian'}, {'path': '/etc/lsb-release', 'name': 'Debian'}, {'path': '/etc/lsb-release', 'name': 'Mandriva'}, - {'path': '/etc/altlinux-release', 'name': 'Altlinux'}, {'path': '/etc/sourcemage-release', 'name': 'SMGL'}, {'path': '/etc/os-release', 'name': 'NA'}, {'path': '/etc/coreos/update.conf', 'name': 'Coreos'}, @@ -82,7 +82,7 @@ class DistributionFiles: SEARCH_STRING = { 'OracleLinux': 'Oracle Linux', 'RedHat': 'Red Hat', - 'Altlinux': 'ALT Linux', + 'Altlinux': 'ALT', 'ClearLinux': 'Clear Linux', 'SMGL': 'Source Mage GNU/Linux', }