Update AlmaLinux patch

This commit is contained in:
Andrew Lukoshko 2024-04-04 08:47:49 +00:00
parent 527d444995
commit dd03fa2b58
2 changed files with 58 additions and 83 deletions

View File

@ -1,7 +1,7 @@
From 1eb69f434883ca685c5ee6136203f28231e18039 Mon Sep 17 00:00:00 2001
From: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
Date: Tue, 10 Oct 2023 02:11:23 +0400
Subject: [PATCH 1/1] Improvements for AlmaLinux OS and CloudLinux OS
From f4f100c0dddf1f11b239374a8dc452739b8e6a81 Mon Sep 17 00:00:00 2001
From: Andrew Lukoshko <alukoshko@almalinux.org>
Date: Thu, 28 Mar 2024 14:24:08 +0000
Subject: [PATCH] Improvements for AlmaLinux OS and CloudLinux OS
Add AlmaLinux OS and CloudLinux OS support to:
@ -14,37 +14,33 @@ Datasources:
- Rbx Cloud Datasource
Systemd services:
- cloud-config.service
- cloud-final.service
- cloud-init-local.service
- cloud-init.service
Signed-off-by: Elkhan Mammadli <elkhan.mammadli@protonmail.com>
---
cloudinit/config/cc_ca_certs.py | 8 ++++
cloudinit/config/cc_ntp.py | 11 ++---
cloudinit/config/cc_resolv_conf.py | 2 +
cloudinit/settings.py | 2 +-
cloudinit/sources/DataSourceRbxCloud.py | 2 +-
systemd/cloud-config.service.tmpl | 2 +-
systemd/cloud-final.service.tmpl | 4 +-
systemd/cloud-init-local.service.tmpl | 12 ++---
systemd/cloud-init.service.tmpl | 4 +-
templates/chrony.conf.almalinux.tmpl | 45 ++++++++++++++++++
templates/chrony.conf.cloudlinux.tmpl | 45 ++++++++++++++++++
templates/ntp.conf.almalinux.tmpl | 61 +++++++++++++++++++++++++
templates/ntp.conf.cloudlinux.tmpl | 61 +++++++++++++++++++++++++
13 files changed, 238 insertions(+), 21 deletions(-)
systemd/cloud-final.service.tmpl | 2 +-
systemd/cloud-init-local.service.tmpl | 10 ++--
systemd/cloud-init.service.tmpl | 2 +-
templates/chrony.conf.almalinux.tmpl | 51 ++++++++++++++++++++
templates/chrony.conf.cloudlinux.tmpl | 51 ++++++++++++++++++++
templates/ntp.conf.almalinux.tmpl | 64 +++++++++++++++++++++++++
templates/ntp.conf.cloudlinux.tmpl | 64 +++++++++++++++++++++++++
12 files changed, 252 insertions(+), 17 deletions(-)
create mode 100644 templates/chrony.conf.almalinux.tmpl
create mode 100644 templates/chrony.conf.cloudlinux.tmpl
create mode 100644 templates/ntp.conf.almalinux.tmpl
create mode 100644 templates/ntp.conf.cloudlinux.tmpl
diff --git a/cloudinit/config/cc_ca_certs.py b/cloudinit/config/cc_ca_certs.py
index 4dc0868..1665d30 100644
index 8d3fd9a..4dd5843 100644
--- a/cloudinit/config/cc_ca_certs.py
+++ b/cloudinit/config/cc_ca_certs.py
@@ -51,6 +51,12 @@ for distro in (
@@ -57,6 +57,12 @@ for distro in (
):
DISTRO_OVERRIDES[distro] = DISTRO_OVERRIDES["opensuse"]
@ -57,7 +53,7 @@ index 4dc0868..1665d30 100644
MODULE_DESCRIPTION = """\
This module adds CA certificates to the system's CA store and updates any
related files using the appropriate OS-specific utility. The default CA
@@ -66,6 +72,8 @@ configuration option ``remove_defaults``.
@@ -72,6 +78,8 @@ configuration option ``remove_defaults``.
order to provide the ``update-ca-certificates`` command.
"""
distros = [
@ -65,12 +61,12 @@ index 4dc0868..1665d30 100644
+ "cloudlinux",
"alpine",
"debian",
"rhel",
"fedora",
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index b5620f3..eae4099 100644
index 9eef24f..1015d43 100644
--- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py
@@ -110,14 +110,6 @@ DISTRO_CLIENT_CONFIG = {
@@ -109,14 +109,6 @@ DISTRO_CLIENT_CONFIG = {
"service_name": "ntpd",
},
},
@ -85,7 +81,7 @@ index b5620f3..eae4099 100644
"cos": {
"chrony": {
"service_name": "chronyd",
@@ -225,6 +217,9 @@ DISTRO_CLIENT_CONFIG = {
@@ -224,6 +216,9 @@ DISTRO_CLIENT_CONFIG = {
for distro in ("opensuse-microos", "opensuse-tumbleweed", "opensuse-leap"):
DISTRO_CLIENT_CONFIG[distro] = DISTRO_CLIENT_CONFIG["opensuse"]
@ -96,10 +92,10 @@ index b5620f3..eae4099 100644
DISTRO_CLIENT_CONFIG[distro] = DISTRO_CLIENT_CONFIG["sles"]
diff --git a/cloudinit/config/cc_resolv_conf.py b/cloudinit/config/cc_resolv_conf.py
index 4629ca7..21057a1 100644
index aa88919..4eb1d76 100644
--- a/cloudinit/config/cc_resolv_conf.py
+++ b/cloudinit/config/cc_resolv_conf.py
@@ -58,7 +58,9 @@ meta: MetaSchema = {
@@ -57,7 +57,9 @@ meta: MetaSchema = {
"title": "Configure resolv.conf",
"description": MODULE_DESCRIPTION,
"distros": [
@ -110,10 +106,10 @@ index 4629ca7..21057a1 100644
"mariner",
"opensuse",
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
index a36c518..9f0a5f4 100644
index 5ced21b..51cb115 100644
--- a/cloudinit/settings.py
+++ b/cloudinit/settings.py
@@ -62,7 +62,7 @@ CFG_BUILTIN = {
@@ -61,7 +61,7 @@ CFG_BUILTIN = {
"cloud_dir": "/var/lib/cloud",
"templates_dir": "/etc/cloud/templates/",
},
@ -123,7 +119,7 @@ index a36c518..9f0a5f4 100644
},
"vendor_data": {"enabled": True, "prefix": []},
diff --git a/cloudinit/sources/DataSourceRbxCloud.py b/cloudinit/sources/DataSourceRbxCloud.py
index 6890562..0b3c80c 100644
index 9214f1b..14880ec 100644
--- a/cloudinit/sources/DataSourceRbxCloud.py
+++ b/cloudinit/sources/DataSourceRbxCloud.py
@@ -60,7 +60,7 @@ def _sub_arp(cmd):
@ -135,33 +131,11 @@ index 6890562..0b3c80c 100644
source_param = "-s"
for item in items:
try:
diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl
index d5568a6..a4d6038 100644
--- a/systemd/cloud-config.service.tmpl
+++ b/systemd/cloud-config.service.tmpl
@@ -4,7 +4,7 @@ Description=Apply the settings specified in cloud-config
After=network-online.target cloud-config.target
After=snapd.seeded.service
Wants=network-online.target cloud-config.target
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
{% endif %}
diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl
index 85f423a..578c7f4 100644
index bcf8b00..6d34761 100644
--- a/systemd/cloud-final.service.tmpl
+++ b/systemd/cloud-final.service.tmpl
@@ -7,7 +7,7 @@ After=multi-user.target
Before=apt-daily.service
{% endif %}
Wants=network-online.target cloud-config.service
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
{% endif %}
@@ -19,7 +19,7 @@ ExecStart=/usr/bin/cloud-init modules --mode=final
@@ -18,7 +18,7 @@ ExecStart=/usr/bin/cloud-init modules --mode=final
RemainAfterExit=yes
TimeoutSec=0
KillMode=process
@ -171,7 +145,7 @@ index 85f423a..578c7f4 100644
ExecStartPost=/bin/sh -c 'u=NetworkManager.service; \
out=$(systemctl show --property=SubState $u) || exit; \
diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
index 6f3f9d8..f5521c4 100644
index 3a1ca7f..853ae2c 100644
--- a/systemd/cloud-init-local.service.tmpl
+++ b/systemd/cloud-init-local.service.tmpl
@@ -1,23 +1,23 @@
@ -202,15 +176,7 @@ index 6f3f9d8..f5521c4 100644
Before=firewalld.target
Conflicts=shutdown.target
{% endif %}
@@ -26,14 +26,14 @@ Before=sysinit.target
Conflicts=shutdown.target
{% endif %}
RequiresMountsFor=/var/lib/cloud
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
{% endif %}
@@ -32,7 +32,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
[Service]
Type=oneshot
@ -220,7 +186,7 @@ index 6f3f9d8..f5521c4 100644
ExecStartPre=/sbin/restorecon /run/cloud-init
ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
index 1b1f9a8..875555d 100644
index bf91164..1ae88f7 100644
--- a/systemd/cloud-init.service.tmpl
+++ b/systemd/cloud-init.service.tmpl
@@ -1,7 +1,7 @@
@ -232,21 +198,12 @@ index 1b1f9a8..875555d 100644
DefaultDependencies=no
{% endif %}
Wants=cloud-init-local.service
@@ -39,7 +39,7 @@ Before=shutdown.target
Conflicts=shutdown.target
{% endif %}
Before=systemd-user-sessions.service
-{% if variant == "rhel" %}
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
ConditionPathExists=!/etc/cloud/cloud-init.disabled
ConditionKernelCommandLine=!cloud-init=disabled
{% endif %}
diff --git a/templates/chrony.conf.almalinux.tmpl b/templates/chrony.conf.almalinux.tmpl
new file mode 100644
index 0000000..5b3542e
index 0000000..43b1f5d
--- /dev/null
+++ b/templates/chrony.conf.almalinux.tmpl
@@ -0,0 +1,45 @@
@@ -0,0 +1,51 @@
+## template:jinja
+# Use public servers from the pool.ntp.org project.
+# Please consider joining the pool (http://www.pool.ntp.org/join.html).
@ -260,6 +217,12 @@ index 0000000..5b3542e
+{% for server in servers -%}
+server {{server}} iburst
+{% endfor %}
+{% for peer in peers -%}
+peer {{peer}}
+{% endfor %}
+{% for a in allow -%}
+allow {{a}}
+{% endfor %}
+
+# Record the rate at which the system clock gains/losses time.
+driftfile /var/lib/chrony/drift
@ -294,10 +257,10 @@ index 0000000..5b3542e
+#log measurements statistics tracking
diff --git a/templates/chrony.conf.cloudlinux.tmpl b/templates/chrony.conf.cloudlinux.tmpl
new file mode 100644
index 0000000..5b3542e
index 0000000..43b1f5d
--- /dev/null
+++ b/templates/chrony.conf.cloudlinux.tmpl
@@ -0,0 +1,45 @@
@@ -0,0 +1,51 @@
+## template:jinja
+# Use public servers from the pool.ntp.org project.
+# Please consider joining the pool (http://www.pool.ntp.org/join.html).
@ -311,6 +274,12 @@ index 0000000..5b3542e
+{% for server in servers -%}
+server {{server}} iburst
+{% endfor %}
+{% for peer in peers -%}
+peer {{peer}}
+{% endfor %}
+{% for a in allow -%}
+allow {{a}}
+{% endfor %}
+
+# Record the rate at which the system clock gains/losses time.
+driftfile /var/lib/chrony/drift
@ -345,10 +314,10 @@ index 0000000..5b3542e
+#log measurements statistics tracking
diff --git a/templates/ntp.conf.almalinux.tmpl b/templates/ntp.conf.almalinux.tmpl
new file mode 100644
index 0000000..62b4776
index 0000000..9884df5
--- /dev/null
+++ b/templates/ntp.conf.almalinux.tmpl
@@ -0,0 +1,61 @@
@@ -0,0 +1,64 @@
+## template:jinja
+
+# For more information about this file, see the man pages
@ -382,6 +351,9 @@ index 0000000..62b4776
+{% for server in servers -%}
+server {{server}} iburst
+{% endfor %}
+{% for peer in peers -%}
+peer {{peer}}
+{% endfor %}
+
+#broadcast 192.168.1.255 autokey # broadcast server
+#broadcastclient # broadcast client
@ -412,10 +384,10 @@ index 0000000..62b4776
+#statistics clockstats cryptostats loopstats peerstats
diff --git a/templates/ntp.conf.cloudlinux.tmpl b/templates/ntp.conf.cloudlinux.tmpl
new file mode 100644
index 0000000..62b4776
index 0000000..9884df5
--- /dev/null
+++ b/templates/ntp.conf.cloudlinux.tmpl
@@ -0,0 +1,61 @@
@@ -0,0 +1,64 @@
+## template:jinja
+
+# For more information about this file, see the man pages
@ -449,6 +421,9 @@ index 0000000..62b4776
+{% for server in servers -%}
+server {{server}} iburst
+{% endfor %}
+{% for peer in peers -%}
+peer {{peer}}
+{% endfor %}
+
+#broadcast 192.168.1.255 autokey # broadcast server
+#broadcastclient # broadcast client
@ -478,5 +453,5 @@ index 0000000..62b4776
+# Enable writing of statistics records.
+#statistics clockstats cryptostats loopstats peerstats
--
2.41.0
2.27.0

View File

@ -6,7 +6,7 @@
Name: cloud-init
Version: 23.4
Release: 5%{?dist}.alma
Release: 5%{?dist}.alma.1
Summary: Cloud instance init scripts
Group: System Environment/Base
@ -253,7 +253,7 @@ fi
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
%changelog
* Wed Mar 27 2024 Elkhan Mammadli <elkhan@almalinux.org> - 23.4-5.alma
* Wed Mar 27 2024 Elkhan Mammadli <elkhan@almalinux.org> - 23.4-5.alma.1
- 0001-Improvements-for-AlmaLinux-OS-and-CloudLinux-OS.patch
* Mon Feb 26 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-5