From eebe728ae81aebc9c7607a71f86d21f677a656be Mon Sep 17 00:00:00 2001 From: Alexander Bethke Date: Wed, 21 Mar 2018 16:50:54 +0100 Subject: [PATCH] Fix SteamOS ansible_distribution fact (Fixes #33628) (#37576) Fixes #33628 --- .../module_utils/facts/system/distribution.py | 5 +++- .../module_utils/test_distribution_version.py | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index 565fb17c7f..440821b0c7 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -311,6 +311,9 @@ class DistributionFiles: elif 'Ubuntu' in data: debian_facts['distribution'] = 'Ubuntu' # nothing else to do, Ubuntu gets correct info from python functions + elif 'SteamOS' in data: + debian_facts['distribution'] = 'SteamOS' + # nothing else to do, SteamOS gets correct info from python functions else: return False, debian_facts @@ -410,7 +413,7 @@ class Distribution(object): 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL', 'Amazon', 'Virtuozzo', 'XenServer'], 'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon', - 'Linux Mint'], + 'Linux Mint', 'SteamOS'], 'Suse': ['SuSE', 'SLES', 'SLED', 'openSUSE', 'openSUSE Tumbleweed', 'SLES_SAP', 'SUSE_LINUX', 'openSUSE Leap'], 'Archlinux': ['Archlinux', 'Antergos', 'Manjaro'], diff --git a/test/units/module_utils/test_distribution_version.py b/test/units/module_utils/test_distribution_version.py index b806099a88..d560f0d422 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -377,6 +377,34 @@ BUG_REPORT_URL="http://bugs.debian.org/" 'distribution_version': u'7.9' } }, + { + 'name': "SteamOS 2.0", + 'input': { + '/etc/os-release': """PRETTY_NAME="SteamOS GNU/Linux 2.0 (brewmaster)" +NAME="SteamOS GNU/Linux" +VERSION_ID="2" +VERSION="2 (brewmaster)" +ID=steamos +ID_LIKE=debian +HOME_URL="http://www.steampowered.com/" +SUPPORT_URL="http://support.steampowered.com/" +BUG_REPORT_URL="http://support.steampowered.com/" +""", + '/etc/lsb-release': """DISTRIB_ID=SteamOS +DISTRIB_RELEASE=2.0 +DISTRIB_CODENAME=brewmaster +DISTRIB_DESCRIPTION="SteamOS 2.0" +""" + }, + 'platform.dist': ('Steamos', '2.0', 'brewmaster'), + 'result': { + 'distribution': u'SteamOS', + 'distribution_major_version': u'2', + 'distribution_release': u'brewmaster', + "os_family": "Debian", + 'distribution_version': u'2.0' + } + }, { "platform.dist": [ "Ubuntu",