summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2021-03-08 04:14:54 -0500
committerGitHub <noreply@github.com>2021-03-08 03:14:54 -0600
commit77b76a32700d0fb958e828de990db7500f3a11aa (patch)
tree1eba642f34f07699f3798076e74cbf8fa28e568e
parentd720a5e42c0e8f44966898f2697a87551a282fdb (diff)
downloadansible-77b76a32700d0fb958e828de990db7500f3a11aa.tar.gz
[stable-2.10] Add AlmaLinux to the family of Red Hat-like operating systems (#73541) (#73543)
* Add changelog and fixtures for AlmaLinux support Co-authored-by: Christoph Schug <com+github@schug.net> (cherry picked from commit 2f5c83dfb1) Co-authored-by: Sam Doran <sdoran@redhat.com>
-rw-r--r--changelogs/fragments/support_almalinux.yml2
-rw-r--r--lib/ansible/module_utils/facts/system/distribution.py2
-rw-r--r--test/units/module_utils/facts/system/distribution/fixtures/almalinux_8_3_beta.json53
3 files changed, 56 insertions, 1 deletions
diff --git a/changelogs/fragments/support_almalinux.yml b/changelogs/fragments/support_almalinux.yml
new file mode 100644
index 0000000000..4dbc040a62
--- /dev/null
+++ b/changelogs/fragments/support_almalinux.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - add AlmaLinux to fact gathering (https://github.com/ansible/ansible/pull/73458)
diff --git a/lib/ansible/module_utils/facts/system/distribution.py b/lib/ansible/module_utils/facts/system/distribution.py
index 8c2c7b427f..09236a9a5e 100644
--- a/lib/ansible/module_utils/facts/system/distribution.py
+++ b/lib/ansible/module_utils/facts/system/distribution.py
@@ -485,7 +485,7 @@ class Distribution(object):
OS_FAMILY_MAP = {'RedHat': ['RedHat', 'Fedora', 'CentOS', 'Scientific', 'SLC',
'Ascendos', 'CloudLinux', 'PSBM', 'OracleLinux', 'OVS',
'OEL', 'Amazon', 'Virtuozzo', 'XenServer', 'Alibaba',
- 'EulerOS', 'openEuler'],
+ 'EulerOS', 'openEuler', 'AlmaLinux'],
'Debian': ['Debian', 'Ubuntu', 'Raspbian', 'Neon', 'KDE neon',
'Linux Mint', 'SteamOS', 'Devuan', 'Kali', 'Cumulus Linux',
'Pop!_OS', ],
diff --git a/test/units/module_utils/facts/system/distribution/fixtures/almalinux_8_3_beta.json b/test/units/module_utils/facts/system/distribution/fixtures/almalinux_8_3_beta.json
new file mode 100644
index 0000000000..2d8df50bf1
--- /dev/null
+++ b/test/units/module_utils/facts/system/distribution/fixtures/almalinux_8_3_beta.json
@@ -0,0 +1,53 @@
+{
+ "name": "AlmaLinux 8.3",
+ "distro": {
+ "codename": "Purple Manul",
+ "id": "almalinux",
+ "name": "AlmaLinux",
+ "version": "8.3",
+ "version_best": "8.3",
+ "lsb_release_info": {
+ "lsb_version": ":core-4.1-amd64:core-4.1-noarch",
+ "distributor_id": "AlmaLinux",
+ "description": "AlmaLinux release 8.3 Beta (Purple Manul)",
+ "release": "8.3",
+ "codename": "PurpleManul"
+ },
+ "os_release_info": {
+ "name": "AlmaLinux",
+ "version": "8.3 (Purple Manul)",
+ "id": "almalinux",
+ "id_like": "rhel centos fedora",
+ "version_id": "8.3",
+ "platform_id": "platform:el8",
+ "pretty_name": "AlmaLinux 8.3 Beta (Purple Manul)",
+ "ansi_color": "0;34",
+ "cpe_name": "cpe:/o:almalinux:almalinux:8.3:beta",
+ "home_url": "https://almalinux.org/",
+ "bug_report_url": "https://bugs.almalinux.org/",
+ "almalinux_mantisbt_project": "AlmaLinux-8",
+ "almalinux_mantisbt_project_version": "8",
+ "codename": "Purple Manul"
+ }
+ },
+ "input": {
+ "/etc/centos-release": "AlmaLinux release 8.3 Beta (Purple Manul)\n",
+ "/etc/redhat-release": "AlmaLinux release 8.3 Beta (Purple Manul)\n",
+ "/etc/system-release": "AlmaLinux release 8.3 Beta (Purple Manul)\n",
+ "/etc/os-release": "NAME=\"AlmaLinux\"\nVERSION=\"8.3 (Purple Manul)\"\nID=\"almalinux\"\nID_LIKE=\"rhel centos fedora\"\nVERSION_ID=\"8.3\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"AlmaLinux 8.3 Beta (Purple Manul)\"\nANSI_COLOR=\"0;34\"\nCPE_NAME=\"cpe:/o:almalinux:almalinux:8.3:beta\"\nHOME_URL=\"https://almalinux.org/\"\nBUG_REPORT_URL=\"https://bugs.almalinux.org/\"\n\nALMALINUX_MANTISBT_PROJECT=\"AlmaLinux-8\" \nALMALINUX_MANTISBT_PROJECT_VERSION=\"8\" \n\n",
+ "/usr/lib/os-release": "NAME=\"AlmaLinux\"\nVERSION=\"8.3 (Purple Manul)\"\nID=\"almalinux\"\nID_LIKE=\"rhel centos fedora\"\nVERSION_ID=\"8.3\"\nPLATFORM_ID=\"platform:el8\"\nPRETTY_NAME=\"AlmaLinux 8.3 Beta (Purple Manul)\"\nANSI_COLOR=\"0;34\"\nCPE_NAME=\"cpe:/o:almalinux:almalinux:8.3:beta\"\nHOME_URL=\"https://almalinux.org/\"\nBUG_REPORT_URL=\"https://bugs.almalinux.org/\"\n\nALMALINUX_MANTISBT_PROJECT=\"AlmaLinux-8\" \nALMALINUX_MANTISBT_PROJECT_VERSION=\"8\" \n\n"
+ },
+ "platform.dist": [
+ "almalinux",
+ "8.3",
+ "Purple Manul"
+ ],
+ "result": {
+ "distribution": "AlmaLinux",
+ "distribution_version": "8.3",
+ "distribution_release": "Purple Manul",
+ "distribution_major_version": "8",
+ "os_family": "RedHat"
+ },
+ "platform.release": "4.18.0-240.el8.x86_64"
+}