From 4e7c7dd9952830cba59b4b64a8e81af01014896b Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Wed, 26 Oct 2022 13:22:54 +0000 Subject: [PATCH] Enable Yum Add Repo module on AlmaLinux --- ...Yum-Add-Repo-module-for-AlmaLinux-OS.patch | 29 +++ SOURCES/cloud-init-20.3-add_almalinux.patch | 185 ------------------ SPECS/cloud-init.spec | 4 +- 3 files changed, 31 insertions(+), 187 deletions(-) create mode 100644 SOURCES/0001-Fix-the-Yum-Add-Repo-module-for-AlmaLinux-OS.patch delete mode 100644 SOURCES/cloud-init-20.3-add_almalinux.patch diff --git a/SOURCES/0001-Fix-the-Yum-Add-Repo-module-for-AlmaLinux-OS.patch b/SOURCES/0001-Fix-the-Yum-Add-Repo-module-for-AlmaLinux-OS.patch new file mode 100644 index 0000000..523ed9b --- /dev/null +++ b/SOURCES/0001-Fix-the-Yum-Add-Repo-module-for-AlmaLinux-OS.patch @@ -0,0 +1,29 @@ +From 68c9e63c581640667f23b87994c446a56136548a Mon Sep 17 00:00:00 2001 +From: Elkhan Mammadli +Date: Wed, 26 Oct 2022 16:37:21 +0400 +Subject: [PATCH 1/1] Fix the Yum Add Repo module for AlmaLinux OS + +Include AlmaLinux OS in the list of distributions +that supports cc_yum_add_repo + +Signed-off-by: Elkhan Mammadli +--- + config/cloud.cfg.tmpl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl +index fb4b456..15747bb 100644 +--- a/config/cloud.cfg.tmpl ++++ b/config/cloud.cfg.tmpl +@@ -111,7 +111,7 @@ cloud_config_modules: + - locale + {% endif %} + - set-passwords +-{% if variant in ["rhel", "fedora", "photon"] %} ++{% if variant in ["almalinux", "rhel", "fedora", "photon"] %} + {% if variant not in ["photon"] %} + - spacewalk + {% endif %} +-- +2.37.3 + diff --git a/SOURCES/cloud-init-20.3-add_almalinux.patch b/SOURCES/cloud-init-20.3-add_almalinux.patch deleted file mode 100644 index 2229242..0000000 --- a/SOURCES/cloud-init-20.3-add_almalinux.patch +++ /dev/null @@ -1,185 +0,0 @@ -From deccb70fbd4d0cf759732c6a59357f74ae1558e4 Mon Sep 17 00:00:00 2001 -From: Andrew Lukoshko -Date: Wed, 7 Apr 2021 23:50:49 +0300 -Subject: [PATCH] Add AlmaLinux OS support - ---- - cloudinit/config/cc_ntp.py | 4 ++-- - cloudinit/config/cc_yum_add_repo.py | 4 ++-- - cloudinit/distros/__init__.py | 2 +- - cloudinit/distros/almalinux.py | 9 +++++++++ - cloudinit/net/sysconfig.py | 2 +- - cloudinit/util.py | 4 ++-- - config/cloud.cfg.tmpl | 6 +++--- - systemd/cloud-init-generator.tmpl | 2 +- - systemd/cloud-init.service.tmpl | 2 +- - tools/.github-cla-signers | 1 + - tools/render-cloudcfg | 4 ++-- - 11 files changed, 25 insertions(+), 15 deletions(-) - create mode 100644 cloudinit/distros/almalinux.py - -diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py -index e183993f1d..41c278ffad 100644 ---- a/cloudinit/config/cc_ntp.py -+++ b/cloudinit/config/cc_ntp.py -@@ -24,8 +24,8 @@ - frequency = PER_INSTANCE - NTP_CONF = '/etc/ntp.conf' - NR_POOL_SERVERS = 4 --distros = ['alpine', 'centos', 'debian', 'fedora', 'opensuse', 'rhel', -- 'sles', 'ubuntu'] -+distros = ['almalinux', 'alpine', 'centos', 'debian', 'fedora', 'opensuse', -+ 'rhel', 'sles', 'ubuntu'] - - NTP_CLIENT_CONFIG = { - 'chrony': { -diff --git a/cloudinit/config/cc_yum_add_repo.py b/cloudinit/config/cc_yum_add_repo.py -index 01fe683cd1..db513ed7dc 100644 ---- a/cloudinit/config/cc_yum_add_repo.py -+++ b/cloudinit/config/cc_yum_add_repo.py -@@ -18,7 +18,7 @@ - - **Module frequency:** per always - --**Supported distros:** centos, fedora, rhel -+**Supported distros:** almalinux, centos, fedora, rhel - - **Config keys**:: - -@@ -36,7 +36,7 @@ - - from cloudinit import util - --distros = ['centos', 'fedora', 'rhel'] -+distros = ['almalinux', 'centos', 'fedora', 'rhel'] - - - def _canonicalize_id(repo_id): -diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py -index 220bd11f2c..2e1200c087 100755 ---- a/cloudinit/distros/__init__.py -+++ b/cloudinit/distros/__init__.py -@@ -46,7 +46,7 @@ - 'debian': ['debian', 'ubuntu'], - 'freebsd': ['freebsd'], - 'gentoo': ['gentoo'], -- 'redhat': ['amazon', 'centos', 'fedora', 'rhel'], -+ 'redhat': ['almalinux', 'amazon', 'centos', 'fedora', 'rhel'], - 'suse': ['opensuse', 'sles'], - } - -diff --git a/cloudinit/distros/almalinux.py b/cloudinit/distros/almalinux.py -new file mode 100644 -index 0000000000..edb3165d2e ---- /dev/null -+++ b/cloudinit/distros/almalinux.py -@@ -0,0 +1,9 @@ -+# This file is part of cloud-init. See LICENSE file for license information. -+ -+from cloudinit.distros import rhel -+ -+ -+class Distro(rhel.Distro): -+ pass -+ -+# vi: ts=4 expandtab -diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py -index 99a4bae459..d732854d0c 100644 ---- a/cloudinit/net/sysconfig.py -+++ b/cloudinit/net/sysconfig.py -@@ -19,7 +19,7 @@ - - LOG = logging.getLogger(__name__) - NM_CFG_FILE = "/etc/NetworkManager/NetworkManager.conf" --KNOWN_DISTROS = ['centos', 'fedora', 'rhel', 'suse'] -+KNOWN_DISTROS = ['almalinux', 'centos', 'fedora', 'rhel', 'suse'] - - - def _make_header(sep='#'): -diff --git a/cloudinit/util.py b/cloudinit/util.py -index 4e0a72db86..fdea1181c0 100644 ---- a/cloudinit/util.py -+++ b/cloudinit/util.py -@@ -521,8 +521,8 @@ def system_info(): - if system == "linux": - linux_dist = info['dist'][0].lower() - if linux_dist in ( -- 'alpine', 'arch', 'centos', 'debian', 'fedora', 'rhel', -- 'suse'): -+ 'almalinux', 'alpine', 'arch', 'centos', 'debian', 'fedora', -+ 'rhel', 'suse'): - var = linux_dist - elif linux_dist in ('ubuntu', 'linuxmint', 'mint'): - var = 'ubuntu' -diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl -index 7171aaa514..8656daa72b 100644 ---- a/config/cloud.cfg.tmpl -+++ b/config/cloud.cfg.tmpl -@@ -21,7 +21,7 @@ disable_root: false - disable_root: true - {% endif %} - --{% if variant in ["alpine", "amazon", "centos", "fedora", "rhel"] %} -+{% if variant in ["almalinux", "alpine", "amazon", "centos", "fedora", "rhel"] %} - mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2'] - {% if variant == "amazon" %} - resize_rootfs: noblock -@@ -153,7 +153,7 @@ cloud_final_modules: - # (not accessible to handlers/transforms) - system_info: - # This will affect which distro class gets used --{% if variant in ["alpine", "amazon", "arch", "centos", "debian", -+{% if variant in ["almalinux", "alpine", "amazon", "arch", "centos", "debian", - "fedora", "freebsd", "netbsd", "openbsd", "rhel", - "suse", "ubuntu"] %} - distro: {{ variant }} -@@ -206,7 +206,7 @@ system_info: - primary: http://ports.ubuntu.com/ubuntu-ports - security: http://ports.ubuntu.com/ubuntu-ports - ssh_svcname: ssh --{% elif variant in ["alpine", "amazon", "arch", "centos", "fedora", -+{% elif variant in ["almalinux", "alpine", "amazon", "arch", "centos", "fedora", - "rhel", "suse"] %} - # Default user name + that default users groups (if added/used) - default_user: -diff --git a/systemd/cloud-init-generator.tmpl b/systemd/cloud-init-generator.tmpl -index 0773356bb6..9b103ef983 100755 ---- a/systemd/cloud-init-generator.tmpl -+++ b/systemd/cloud-init-generator.tmpl -@@ -83,7 +83,7 @@ default() { - - check_for_datasource() { - local ds_rc="" --{% if variant in ["rhel", "fedora", "centos"] %} -+{% if variant in ["almalinux", "rhel", "fedora", "centos"] %} - local dsidentify="/usr/libexec/cloud-init/ds-identify" - {% else %} - local dsidentify="/usr/lib/cloud-init/ds-identify" -diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl -index f140344db5..a5c5127715 100644 ---- a/systemd/cloud-init.service.tmpl -+++ b/systemd/cloud-init.service.tmpl -@@ -10,7 +10,7 @@ After=systemd-networkd-wait-online.service - {% if variant in ["ubuntu", "unknown", "debian"] %} - After=networking.service - {% endif %} --{% if variant in ["centos", "fedora", "rhel"] %} -+{% if variant in ["almalinux", "centos", "fedora", "rhel"] %} - After=network.service - After=NetworkManager.service - {% endif %} -diff --git a/tools/render-cloudcfg b/tools/render-cloudcfg -index ed4548400d..f599074801 100755 ---- a/tools/render-cloudcfg -+++ b/tools/render-cloudcfg -@@ -4,8 +4,8 @@ import argparse - import os - import sys - --VARIANTS = ["alpine", "amazon", "arch", "centos", "debian", "fedora", -- "freebsd", "netbsd", "openbsd", "rhel", "suse", "ubuntu", -+VARIANTS = ["almalinux", "alpine", "amazon", "arch", "centos", "debian", -+ "fedora", "freebsd", "netbsd", "openbsd", "rhel", "suse", "ubuntu", - "unknown"] - - diff --git a/SPECS/cloud-init.spec b/SPECS/cloud-init.spec index 8ea6830..9eba34f 100644 --- a/SPECS/cloud-init.spec +++ b/SPECS/cloud-init.spec @@ -47,7 +47,7 @@ Patch13: ci-Revert-Add-native-NetworkManager-support-1224.patch Patch14: ci-Revert-Use-Network-Manager-and-Netplan-as-default-re.patch # AlmaLinux patches -Patch100: cloud-init-20.3-add_almalinux.patch +Patch100: 0001-Fix-the-Yum-Add-Repo-module-for-AlmaLinux-OS.patch BuildArch: noarch @@ -233,7 +233,7 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog -* Fri Apr 01 2022 Eduard Abdullin - 22.1-5.alma +* Wed Oct 26 2022 Eduard Abdullin - 22.1-5.alma - AlmaLinux changes * Wed Aug 17 2022 Jon Maloy - 22.1-5