From 794d269a4d7b02ff0a5d44353d22c86bea1e8d26 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 5 May 2020 22:13:28 +0530 Subject: [PATCH] Distribution: Add PopOS as Debian OS_FAMILY (#69294) PopOS is a Debian based OS distribution, added support to detect ansible_os_family as 'debian' instead of 'Pop!_OS' Fixes: #69286 Signed-off-by: Abhijeet Kasurde --- .../fragments/69286_pop_os_distribution.yml | 2 ++ .../module_utils/facts/system/distribution.py | 3 +- .../module_utils/test_distribution_version.py | 29 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/69286_pop_os_distribution.yml diff --git a/changelogs/fragments/69286_pop_os_distribution.yml b/changelogs/fragments/69286_pop_os_distribution.yml new file mode 100644 index 00000000000000..3d65ab4a2721ff --- /dev/null +++ b/changelogs/fragments/69286_pop_os_distribution.yml @@ -0,0 +1,2 @@ +minor_changes: +- Added PopOS as a part of Debian OS distribution family (https://github.com/ansible/ansible/issues/69286). diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py index 528b0e2b9e5f9b..3d8c35582b39c4 100644 --- a/lib/ansible/module_utils/facts/system/distribution.py +++ b/lib/ansible/module_utils/facts/system/distribution.py @@ -469,7 +469,8 @@ class Distribution(object): 'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba', 'EulerOS'], 'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon', - 'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux'], + 'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux', + 'Pop!_OS', ], '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 c709b76a5325df..abb05116098bb9 100644 --- a/test/units/module_utils/test_distribution_version.py +++ b/test/units/module_utils/test_distribution_version.py @@ -1843,6 +1843,35 @@ "lsb_release_info": {}, }, }, + { + "name": "Pop!_OS 20.04", + "distro": { + "codename": "focal", + "id": "pop", + "name": "Pop!_OS", + "version": "20.04", + "version_best": "20.04", + 'os_release_info': {}, + 'lsb_release_info': {}, + }, + "input": { + "/etc/os-release": "NAME=\"Pop!_OS\"\nVERSION=\"20.04\"\nID=pop\nID_LIKE=\"ubuntu debian\"\nPRETTY_NAME=\"Pop!_OS 20.04\"\nVERSION_ID=\"20.04\"\nHOME_URL=\"https://system76.com/pop\"\nSUPPORT_URL=\"http://support.system76.com\"\nBUG_REPORT_URL=\"https://github.com/pop-os/pop/issues\"\nPRIVACY_POLICY_URL=\"https://system76.com/privacy\"\nVERSION_CODENAME=focal\nUBUNTU_CODENAME=focal\nLOGO=distributor-logo-pop-os\n", # noqa + "/etc/lsb-release": "DISTRIB_ID=Pop\nDISTRIB_RELEASE=20.04\nDISTRIB_CODENAME=focal\nDISTRIB_DESCRIPTION=\"Pop!_OS 20.04\"\n", + "/usr/lib/os-release": "NAME=\"Pop!_OS\"\nVERSION=\"20.04\"\nID=pop\nID_LIKE=\"ubuntu debian\"\nPRETTY_NAME=\"Pop!_OS 20.04\"\nVERSION_ID=\"20.04\"\nHOME_URL=\"https://system76.com/pop\"\nSUPPORT_URL=\"http://support.system76.com\"\nBUG_REPORT_URL=\"https://github.com/pop-os/pop/issues\"\nPRIVACY_POLICY_URL=\"https://system76.com/privacy\"\nVERSION_CODENAME=focal\nUBUNTU_CODENAME=focal\nLOGO=distributor-logo-pop-os\n", # noqa + }, + "platform.dist": [ + "pop", + "20.04", + "focal" + ], + "result": { + "distribution": "Pop!_OS", + "distribution_version": "20.04", + "distribution_release": "focal", + "distribution_major_version": "20", + "os_family": "Debian" + } + }, ]