Compare commits
No commits in common. "changed/a8-beta/cloud-init-23.4-5.el8.alma.1" and "c8" have entirely different histories.
changed/a8
...
c8
|
@ -1,457 +0,0 @@
|
|||
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:
|
||||
|
||||
Modules:
|
||||
- cc_ca_certs
|
||||
- cc_ntp
|
||||
- cc_resolv_conf
|
||||
|
||||
Datasources:
|
||||
- Rbx Cloud Datasource
|
||||
|
||||
Systemd services:
|
||||
- cloud-final.service
|
||||
- cloud-init-local.service
|
||||
- cloud-init.service
|
||||
---
|
||||
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-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 8d3fd9a..4dd5843 100644
|
||||
--- a/cloudinit/config/cc_ca_certs.py
|
||||
+++ b/cloudinit/config/cc_ca_certs.py
|
||||
@@ -57,6 +57,12 @@ for distro in (
|
||||
):
|
||||
DISTRO_OVERRIDES[distro] = DISTRO_OVERRIDES["opensuse"]
|
||||
|
||||
+for distro in (
|
||||
+ "almalinux",
|
||||
+ "cloudlinux",
|
||||
+):
|
||||
+ DISTRO_OVERRIDES[distro] = DISTRO_OVERRIDES["rhel"]
|
||||
+
|
||||
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
|
||||
@@ -72,6 +78,8 @@ configuration option ``remove_defaults``.
|
||||
order to provide the ``update-ca-certificates`` command.
|
||||
"""
|
||||
distros = [
|
||||
+ "almalinux",
|
||||
+ "cloudlinux",
|
||||
"alpine",
|
||||
"debian",
|
||||
"fedora",
|
||||
diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
|
||||
index 9eef24f..1015d43 100644
|
||||
--- a/cloudinit/config/cc_ntp.py
|
||||
+++ b/cloudinit/config/cc_ntp.py
|
||||
@@ -109,14 +109,6 @@ DISTRO_CLIENT_CONFIG = {
|
||||
"service_name": "ntpd",
|
||||
},
|
||||
},
|
||||
- "centos": {
|
||||
- "ntp": {
|
||||
- "service_name": "ntpd",
|
||||
- },
|
||||
- "chrony": {
|
||||
- "service_name": "chronyd",
|
||||
- },
|
||||
- },
|
||||
"cos": {
|
||||
"chrony": {
|
||||
"service_name": "chronyd",
|
||||
@@ -224,6 +216,9 @@ DISTRO_CLIENT_CONFIG = {
|
||||
for distro in ("opensuse-microos", "opensuse-tumbleweed", "opensuse-leap"):
|
||||
DISTRO_CLIENT_CONFIG[distro] = DISTRO_CLIENT_CONFIG["opensuse"]
|
||||
|
||||
+for distro in ("almalinux", "centos", "cloudlinux"):
|
||||
+ DISTRO_CLIENT_CONFIG[distro] = DISTRO_CLIENT_CONFIG["rhel"]
|
||||
+
|
||||
for distro in ("sle_hpc", "sle-micro"):
|
||||
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 aa88919..4eb1d76 100644
|
||||
--- a/cloudinit/config/cc_resolv_conf.py
|
||||
+++ b/cloudinit/config/cc_resolv_conf.py
|
||||
@@ -57,7 +57,9 @@ meta: MetaSchema = {
|
||||
"title": "Configure resolv.conf",
|
||||
"description": MODULE_DESCRIPTION,
|
||||
"distros": [
|
||||
+ "almalinux",
|
||||
"alpine",
|
||||
+ "cloudlinux",
|
||||
"fedora",
|
||||
"mariner",
|
||||
"opensuse",
|
||||
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
|
||||
index 5ced21b..51cb115 100644
|
||||
--- a/cloudinit/settings.py
|
||||
+++ b/cloudinit/settings.py
|
||||
@@ -61,7 +61,7 @@ CFG_BUILTIN = {
|
||||
"cloud_dir": "/var/lib/cloud",
|
||||
"templates_dir": "/etc/cloud/templates/",
|
||||
},
|
||||
- "distro": "rhel",
|
||||
+ "distro": "almalinux",
|
||||
"network": {"renderers": None},
|
||||
},
|
||||
"vendor_data": {"enabled": True, "prefix": []},
|
||||
diff --git a/cloudinit/sources/DataSourceRbxCloud.py b/cloudinit/sources/DataSourceRbxCloud.py
|
||||
index 9214f1b..14880ec 100644
|
||||
--- a/cloudinit/sources/DataSourceRbxCloud.py
|
||||
+++ b/cloudinit/sources/DataSourceRbxCloud.py
|
||||
@@ -60,7 +60,7 @@ def _sub_arp(cmd):
|
||||
|
||||
def gratuitous_arp(items, distro):
|
||||
source_param = "-S"
|
||||
- if distro.name in ["fedora", "centos", "rhel"]:
|
||||
+ if distro.name in ["almalinux", "fedora", "centos", "cloudlinux", "rhel"]:
|
||||
source_param = "-s"
|
||||
for item in items:
|
||||
try:
|
||||
diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl
|
||||
index bcf8b00..6d34761 100644
|
||||
--- a/systemd/cloud-final.service.tmpl
|
||||
+++ b/systemd/cloud-final.service.tmpl
|
||||
@@ -18,7 +18,7 @@ ExecStart=/usr/bin/cloud-init modules --mode=final
|
||||
RemainAfterExit=yes
|
||||
TimeoutSec=0
|
||||
KillMode=process
|
||||
-{% if variant == "rhel" %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
|
||||
# Restart NetworkManager if it is present and running.
|
||||
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 3a1ca7f..853ae2c 100644
|
||||
--- a/systemd/cloud-init-local.service.tmpl
|
||||
+++ b/systemd/cloud-init-local.service.tmpl
|
||||
@@ -1,23 +1,23 @@
|
||||
## template:jinja
|
||||
[Unit]
|
||||
Description=Initial cloud-init job (pre-networking)
|
||||
-{% if variant in ["ubuntu", "unknown", "debian", "rhel" ] %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "ubuntu", "unknown", "debian", "rhel" ] %}
|
||||
DefaultDependencies=no
|
||||
{% endif %}
|
||||
Wants=network-pre.target
|
||||
After=hv_kvp_daemon.service
|
||||
After=systemd-remount-fs.service
|
||||
-{% if variant == "rhel" %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
|
||||
Requires=dbus.socket
|
||||
After=dbus.socket
|
||||
{% endif %}
|
||||
Before=NetworkManager.service
|
||||
-{% if variant == "rhel" %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
|
||||
Before=network.service
|
||||
{% endif %}
|
||||
Before=network-pre.target
|
||||
Before=shutdown.target
|
||||
-{% if variant == "rhel" %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
|
||||
Before=firewalld.target
|
||||
Conflicts=shutdown.target
|
||||
{% endif %}
|
||||
@@ -32,7 +32,7 @@ ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
-{% if variant == "rhel" %}
|
||||
+{% if variant in ["almalinux", "cloudlinux", "rhel"] %}
|
||||
ExecStartPre=/bin/mkdir -p /run/cloud-init
|
||||
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 bf91164..1ae88f7 100644
|
||||
--- a/systemd/cloud-init.service.tmpl
|
||||
+++ b/systemd/cloud-init.service.tmpl
|
||||
@@ -1,7 +1,7 @@
|
||||
## template:jinja
|
||||
[Unit]
|
||||
Description=Initial cloud-init job (metadata service crawler)
|
||||
-{% if variant not in ["photon", "rhel"] %}
|
||||
+{% if variant not in ["almalinux", "cloudlinux", "photon", "rhel"] %}
|
||||
DefaultDependencies=no
|
||||
{% endif %}
|
||||
Wants=cloud-init-local.service
|
||||
diff --git a/templates/chrony.conf.almalinux.tmpl b/templates/chrony.conf.almalinux.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..43b1f5d
|
||||
--- /dev/null
|
||||
+++ b/templates/chrony.conf.almalinux.tmpl
|
||||
@@ -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).
|
||||
+{% if pools %}# pools
|
||||
+{% endif %}
|
||||
+{% for pool in pools -%}
|
||||
+pool {{pool}} iburst
|
||||
+{% endfor %}
|
||||
+{%- if servers %}# servers
|
||||
+{% endif %}
|
||||
+{% 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
|
||||
+
|
||||
+# Allow the system clock to be stepped in the first three updates
|
||||
+# if its offset is larger than 1 second.
|
||||
+makestep 1.0 3
|
||||
+
|
||||
+# Enable kernel synchronization of the real-time clock (RTC).
|
||||
+rtcsync
|
||||
+
|
||||
+# Enable hardware timestamping on all interfaces that support it.
|
||||
+#hwtimestamp *
|
||||
+
|
||||
+# Increase the minimum number of selectable sources required to adjust
|
||||
+# the system clock.
|
||||
+#minsources 2
|
||||
+
|
||||
+# Allow NTP client access from local network.
|
||||
+#allow 192.168.0.0/16
|
||||
+
|
||||
+# Serve time even if not synchronized to a time source.
|
||||
+#local stratum 10
|
||||
+
|
||||
+# Specify file containing keys for NTP authentication.
|
||||
+#keyfile /etc/chrony.keys
|
||||
+
|
||||
+# Specify directory for log files.
|
||||
+logdir /var/log/chrony
|
||||
+
|
||||
+# Select which information is logged.
|
||||
+#log measurements statistics tracking
|
||||
diff --git a/templates/chrony.conf.cloudlinux.tmpl b/templates/chrony.conf.cloudlinux.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..43b1f5d
|
||||
--- /dev/null
|
||||
+++ b/templates/chrony.conf.cloudlinux.tmpl
|
||||
@@ -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).
|
||||
+{% if pools %}# pools
|
||||
+{% endif %}
|
||||
+{% for pool in pools -%}
|
||||
+pool {{pool}} iburst
|
||||
+{% endfor %}
|
||||
+{%- if servers %}# servers
|
||||
+{% endif %}
|
||||
+{% 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
|
||||
+
|
||||
+# Allow the system clock to be stepped in the first three updates
|
||||
+# if its offset is larger than 1 second.
|
||||
+makestep 1.0 3
|
||||
+
|
||||
+# Enable kernel synchronization of the real-time clock (RTC).
|
||||
+rtcsync
|
||||
+
|
||||
+# Enable hardware timestamping on all interfaces that support it.
|
||||
+#hwtimestamp *
|
||||
+
|
||||
+# Increase the minimum number of selectable sources required to adjust
|
||||
+# the system clock.
|
||||
+#minsources 2
|
||||
+
|
||||
+# Allow NTP client access from local network.
|
||||
+#allow 192.168.0.0/16
|
||||
+
|
||||
+# Serve time even if not synchronized to a time source.
|
||||
+#local stratum 10
|
||||
+
|
||||
+# Specify file containing keys for NTP authentication.
|
||||
+#keyfile /etc/chrony.keys
|
||||
+
|
||||
+# Specify directory for log files.
|
||||
+logdir /var/log/chrony
|
||||
+
|
||||
+# Select which information is logged.
|
||||
+#log measurements statistics tracking
|
||||
diff --git a/templates/ntp.conf.almalinux.tmpl b/templates/ntp.conf.almalinux.tmpl
|
||||
new file mode 100644
|
||||
index 0000000..9884df5
|
||||
--- /dev/null
|
||||
+++ b/templates/ntp.conf.almalinux.tmpl
|
||||
@@ -0,0 +1,64 @@
|
||||
+## template:jinja
|
||||
+
|
||||
+# For more information about this file, see the man pages
|
||||
+# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
|
||||
+
|
||||
+driftfile /var/lib/ntp/drift
|
||||
+
|
||||
+# Permit time synchronization with our time source, but do not
|
||||
+# permit the source to query or modify the service on this system.
|
||||
+restrict default kod nomodify notrap nopeer noquery
|
||||
+restrict -6 default kod nomodify notrap nopeer noquery
|
||||
+
|
||||
+# Permit all access over the loopback interface. This could
|
||||
+# be tightened as well, but to do so would effect some of
|
||||
+# the administrative functions.
|
||||
+restrict 127.0.0.1
|
||||
+restrict -6 ::1
|
||||
+
|
||||
+# Hosts on local network are less restricted.
|
||||
+#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
|
||||
+
|
||||
+# Use public servers from the pool.ntp.org project.
|
||||
+# Please consider joining the pool (http://www.pool.ntp.org/join.html).
|
||||
+{% if pools %}# pools
|
||||
+{% endif %}
|
||||
+{% for pool in pools -%}
|
||||
+pool {{pool}} iburst
|
||||
+{% endfor %}
|
||||
+{%- if servers %}# servers
|
||||
+{% endif %}
|
||||
+{% 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
|
||||
+#broadcast 224.0.1.1 autokey # multicast server
|
||||
+#multicastclient 224.0.1.1 # multicast client
|
||||
+#manycastserver 239.255.254.254 # manycast server
|
||||
+#manycastclient 239.255.254.254 autokey # manycast client
|
||||
+
|
||||
+# Enable public key cryptography.
|
||||
+#crypto
|
||||
+
|
||||
+includefile /etc/ntp/crypto/pw
|
||||
+
|
||||
+# Key file containing the keys and key identifiers used when operating
|
||||
+# with symmetric key cryptography.
|
||||
+keys /etc/ntp/keys
|
||||
+
|
||||
+# Specify the key identifiers which are trusted.
|
||||
+#trustedkey 4 8 42
|
||||
+
|
||||
+# Specify the key identifier to use with the ntpdc utility.
|
||||
+#requestkey 8
|
||||
+
|
||||
+# Specify the key identifier to use with the ntpq utility.
|
||||
+#controlkey 8
|
||||
+
|
||||
+# Enable writing of statistics records.
|
||||
+#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..9884df5
|
||||
--- /dev/null
|
||||
+++ b/templates/ntp.conf.cloudlinux.tmpl
|
||||
@@ -0,0 +1,64 @@
|
||||
+## template:jinja
|
||||
+
|
||||
+# For more information about this file, see the man pages
|
||||
+# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
|
||||
+
|
||||
+driftfile /var/lib/ntp/drift
|
||||
+
|
||||
+# Permit time synchronization with our time source, but do not
|
||||
+# permit the source to query or modify the service on this system.
|
||||
+restrict default kod nomodify notrap nopeer noquery
|
||||
+restrict -6 default kod nomodify notrap nopeer noquery
|
||||
+
|
||||
+# Permit all access over the loopback interface. This could
|
||||
+# be tightened as well, but to do so would effect some of
|
||||
+# the administrative functions.
|
||||
+restrict 127.0.0.1
|
||||
+restrict -6 ::1
|
||||
+
|
||||
+# Hosts on local network are less restricted.
|
||||
+#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
|
||||
+
|
||||
+# Use public servers from the pool.ntp.org project.
|
||||
+# Please consider joining the pool (http://www.pool.ntp.org/join.html).
|
||||
+{% if pools %}# pools
|
||||
+{% endif %}
|
||||
+{% for pool in pools -%}
|
||||
+pool {{pool}} iburst
|
||||
+{% endfor %}
|
||||
+{%- if servers %}# servers
|
||||
+{% endif %}
|
||||
+{% 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
|
||||
+#broadcast 224.0.1.1 autokey # multicast server
|
||||
+#multicastclient 224.0.1.1 # multicast client
|
||||
+#manycastserver 239.255.254.254 # manycast server
|
||||
+#manycastclient 239.255.254.254 autokey # manycast client
|
||||
+
|
||||
+# Enable public key cryptography.
|
||||
+#crypto
|
||||
+
|
||||
+includefile /etc/ntp/crypto/pw
|
||||
+
|
||||
+# Key file containing the keys and key identifiers used when operating
|
||||
+# with symmetric key cryptography.
|
||||
+keys /etc/ntp/keys
|
||||
+
|
||||
+# Specify the key identifiers which are trusted.
|
||||
+#trustedkey 4 8 42
|
||||
+
|
||||
+# Specify the key identifier to use with the ntpdc utility.
|
||||
+#requestkey 8
|
||||
+
|
||||
+# Specify the key identifier to use with the ntpq utility.
|
||||
+#controlkey 8
|
||||
+
|
||||
+# Enable writing of statistics records.
|
||||
+#statistics clockstats cryptostats loopstats peerstats
|
||||
--
|
||||
2.27.0
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
From 9da40a7e46e40eb090538f9d8a5aa6049fbbc5b8 Mon Sep 17 00:00:00 2001
|
||||
From: Ani Sinha <anisinha@redhat.com>
|
||||
Date: Tue, 12 Mar 2024 12:52:10 +0530
|
||||
Subject: [PATCH] Retain exit code in cloud-init status for recoverable errors
|
||||
|
||||
RH-Author: Ani Sinha <None>
|
||||
RH-MergeRequest: 126: Retain exit code in cloud-init status for recoverable errors
|
||||
RH-Jira: RHEL-28817
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||
RH-Commit: [1/1] 8c45ffe77ed8e964c35af4705d65daaf8282038f
|
||||
|
||||
Version 23.4 of cloud-init changed the status code reported by cloud-init for
|
||||
recoverable errors from 0 to 2. Please see the commit
|
||||
70acb7f2a30d58 ("Add support for cloud-init "degraded" state (#4500)")
|
||||
|
||||
This change has the potential to break customers who are expecting a 0 status
|
||||
and where warnings can be expected. Hence, revert the status code from 2 to 0
|
||||
even in case of recoverable errors. This retains the old behavior and hence
|
||||
avoids breaking scripts and software stack that expects 0 on the end user side.
|
||||
|
||||
Cannonical has made a similar change downstream for similar reasons. Please see
|
||||
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/2048522
|
||||
and the corresponding downstream patch:
|
||||
https://github.com/canonical/cloud-init/pull/4747/commits/adce34bfd214e4eecdf87329486f30f0898dd303
|
||||
|
||||
This patch has limited risk as it narrowly only restores the old status
|
||||
code for recoverable errors and does not modify anything else.
|
||||
|
||||
X-downstream-only: true
|
||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||
---
|
||||
cloudinit/cmd/status.py | 2 +-
|
||||
tests/unittests/cmd/test_status.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cloudinit/cmd/status.py b/cloudinit/cmd/status.py
|
||||
index f5ee9c11..849c80bc 100644
|
||||
--- a/cloudinit/cmd/status.py
|
||||
+++ b/cloudinit/cmd/status.py
|
||||
@@ -225,7 +225,7 @@ def handle_status_args(name, args) -> int:
|
||||
return 1
|
||||
# Recoverable error
|
||||
elif details.status in UXAppStatusDegradedMap.values():
|
||||
- return 2
|
||||
+ return 0
|
||||
return 0
|
||||
|
||||
|
||||
diff --git a/tests/unittests/cmd/test_status.py b/tests/unittests/cmd/test_status.py
|
||||
index 6c85a59a..567b517a 100644
|
||||
--- a/tests/unittests/cmd/test_status.py
|
||||
+++ b/tests/unittests/cmd/test_status.py
|
||||
@@ -636,7 +636,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
|
||||
},
|
||||
None,
|
||||
MyArgs(long=False, wait=False, format="json"),
|
||||
- 2,
|
||||
+ 0,
|
||||
{
|
||||
"boot_status_code": "enabled-by-kernel-cmdline",
|
||||
"datasource": "nocloud",
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
From 42aad98557bb62ae693f38e5f1e137bcc44f6046 Mon Sep 17 00:00:00 2001
|
||||
From: Ani Sinha <anisinha@redhat.com>
|
||||
Date: Tue, 5 Mar 2024 12:42:26 +0530
|
||||
Subject: [PATCH] Revert "systemd: Standardize cloud-init systemd enablement
|
||||
(#4399)"
|
||||
|
||||
RH-Author: Ani Sinha <None>
|
||||
RH-MergeRequest: 124: Revert "systemd: Standardize cloud-init systemd enablement (#4399)"
|
||||
RH-Jira: RHEL-21290
|
||||
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
|
||||
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
||||
RH-Commit: [1/1] 10da53e761e25ff7d254a4cfb8fb1fd18de8b4ed
|
||||
|
||||
This reverts commit ec7dde8041d4023b09324e84abe37dc766ebbaf6.
|
||||
|
||||
'ConditionEnvironment' clause is not available in RHEL 8.10 systemd and adding
|
||||
the feature would be complicated. Hence reverting the patch seems to be the
|
||||
right thing to do as it was a simple enhancement to make sure all distros use
|
||||
systemd's kernel commandline and file conditionals. We only care about RHEL so
|
||||
the change should not affect us.
|
||||
|
||||
Signed-off-by: Ani Sinha <anisinha@redhat.com>
|
||||
---
|
||||
systemd/cloud-config.service.tmpl | 3 ++-
|
||||
systemd/cloud-final.service.tmpl | 3 ++-
|
||||
systemd/cloud-init-local.service.tmpl | 3 ++-
|
||||
systemd/cloud-init.service.tmpl | 3 ++-
|
||||
systemd/cloud-init.target | 3 ---
|
||||
5 files changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/systemd/cloud-config.service.tmpl b/systemd/cloud-config.service.tmpl
|
||||
index 31d9d983..76e50ae1 100644
|
||||
--- a/systemd/cloud-config.service.tmpl
|
||||
+++ b/systemd/cloud-config.service.tmpl
|
||||
@@ -5,9 +5,10 @@ After=network-online.target cloud-config.target
|
||||
After=snapd.seeded.service
|
||||
Before=systemd-user-sessions.service
|
||||
Wants=network-online.target cloud-config.target
|
||||
+{% if variant == "rhel" %}
|
||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
||||
ConditionKernelCommandLine=!cloud-init=disabled
|
||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
+{% endif %}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
diff --git a/systemd/cloud-final.service.tmpl b/systemd/cloud-final.service.tmpl
|
||||
index bcf8b009..85f423ac 100644
|
||||
--- a/systemd/cloud-final.service.tmpl
|
||||
+++ b/systemd/cloud-final.service.tmpl
|
||||
@@ -7,9 +7,10 @@ After=multi-user.target
|
||||
Before=apt-daily.service
|
||||
{% endif %}
|
||||
Wants=network-online.target cloud-config.service
|
||||
+{% if variant == "rhel" %}
|
||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
||||
ConditionKernelCommandLine=!cloud-init=disabled
|
||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
+{% endif %}
|
||||
|
||||
|
||||
[Service]
|
||||
diff --git a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
|
||||
index 3a1ca7fa..6f3f9d8d 100644
|
||||
--- a/systemd/cloud-init-local.service.tmpl
|
||||
+++ b/systemd/cloud-init-local.service.tmpl
|
||||
@@ -26,9 +26,10 @@ Before=sysinit.target
|
||||
Conflicts=shutdown.target
|
||||
{% endif %}
|
||||
RequiresMountsFor=/var/lib/cloud
|
||||
+{% if variant == "rhel" %}
|
||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
||||
ConditionKernelCommandLine=!cloud-init=disabled
|
||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
+{% endif %}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
diff --git a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
|
||||
index bf91164a..26d2e39c 100644
|
||||
--- a/systemd/cloud-init.service.tmpl
|
||||
+++ b/systemd/cloud-init.service.tmpl
|
||||
@@ -38,9 +38,10 @@ Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
Conflicts=shutdown.target
|
||||
{% endif %}
|
||||
+{% if variant == "rhel" %}
|
||||
ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
||||
ConditionKernelCommandLine=!cloud-init=disabled
|
||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
+{% endif %}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
diff --git a/systemd/cloud-init.target b/systemd/cloud-init.target
|
||||
index 30450f7f..760dfee5 100644
|
||||
--- a/systemd/cloud-init.target
|
||||
+++ b/systemd/cloud-init.target
|
||||
@@ -10,6 +10,3 @@
|
||||
[Unit]
|
||||
Description=Cloud-init target
|
||||
After=multi-user.target
|
||||
-ConditionPathExists=!/etc/cloud/cloud-init.disabled
|
||||
-ConditionKernelCommandLine=!cloud-init=disabled
|
||||
-ConditionEnvironment=!KERNEL_CMDLINE=cloud-init=disabled
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
Name: cloud-init
|
||||
Version: 23.4
|
||||
Release: 5%{?dist}.alma.1
|
||||
Release: 7%{?dist}
|
||||
Summary: Cloud instance init scripts
|
||||
|
||||
Group: System Environment/Base
|
||||
|
@ -35,9 +35,10 @@ Patch19: ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch
|
|||
Patch20: ci-ci-Pin-pytest-8.0.0.-4816.patch
|
||||
# For RHEL-21323 - [rhel-8] The schema WARNING info for network-config.json is not suitable in cloud-init-23.4
|
||||
Patch21: ci-fix-Add-types-to-network-v1-schema-4841.patch
|
||||
|
||||
# AlmaLinux OS patches
|
||||
Patch100: 0001-Improvements-for-AlmaLinux-OS-and-CloudLinux-OS.patch
|
||||
# For RHEL-21290 - Unknown lvalue 'ConditionEnvironment' in section 'Unit' for /usr/lib/systemd/system/cloud-init.target,cloud-init.service
|
||||
Patch22: ci-Revert-systemd-Standardize-cloud-init-systemd-enable.patch
|
||||
# For RHEL-28817 - [RHEL 8.10] cloud-init 23.4 returns 2 on recoverable errors instead of 0
|
||||
Patch23: ci-Retain-exit-code-in-cloud-init-status-for-recoverabl.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
|
@ -253,14 +254,22 @@ fi
|
|||
%config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf
|
||||
|
||||
%changelog
|
||||
* Wed Mar 27 2024 Elkhan Mammadli <elkhan@almalinux.org> - 23.4-5.alma.1
|
||||
- 0001-Improvements-for-AlmaLinux-OS-and-CloudLinux-OS.patch
|
||||
* Thu Mar 14 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-7
|
||||
- ci-Retain-exit-code-in-cloud-init-status-for-recoverabl.patch [RHEL-28817]
|
||||
- Resolves: RHEL-28817
|
||||
([RHEL 8.10] cloud-init 23.4 returns 2 on recoverable errors instead of 0)
|
||||
|
||||
* Mon Mar 11 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-6
|
||||
- ci-Revert-systemd-Standardize-cloud-init-systemd-enable.patch [RHEL-21290]
|
||||
- Resolves: RHEL-21290
|
||||
(Unknown lvalue 'ConditionEnvironment' in section 'Unit' for /usr/lib/systemd/system/cloud-init.target,cloud-init.service)
|
||||
|
||||
* Mon Feb 26 2024 Miroslav Rezanina <mrezanin@redhat.com> - 23.4-5
|
||||
- ci-ci-Pin-pytest-8.0.0.-4816.patch [RHEL-21323]
|
||||
- ci-fix-Add-types-to-network-v1-schema-4841.patch [RHEL-21323]
|
||||
- Resolves: RHEL-21323
|
||||
([rhel-8] The schema WARNING info for network-config.json is not suitable in cloud-init-23.4)
|
||||
|
||||
* Fri Feb 02 2024 Jon Maloy <jmaloy@redhat.com> - 23.4-4
|
||||
- ci-Revert-Use-grep-for-faster-parsing-of-cloud-config-i.patch [RHEL-22248]
|
||||
- Resolves: RHEL-22248
|
||||
|
@ -301,6 +310,7 @@ fi
|
|||
* Fri Aug 25 2023 Camilla Conte <cconte@redhat.com> - 23.1.1-10
|
||||
- Resolves: bz#2233047
|
||||
([RHEL 8.9] Inform user when cloud-init generated config files are left during uninstalling)
|
||||
|
||||
* Wed Aug 09 2023 Jon Maloy <jmaloy@redhat.com> - 23.1.1-9
|
||||
- ci-NM-renderer-set-default-IPv6-addr-gen-mode-for-all-i.patch [bz#2229460]
|
||||
- Resolves: bz#2229460
|
||||
|
@ -357,6 +367,7 @@ fi
|
|||
- ci-cc_set_hostname-ignore-var-lib-cloud-data-set-hostna.patch [bz#2162258]
|
||||
- Resolves: bz#2162258
|
||||
(systemd[1]: Failed to start Initial cloud-init job after reboot system via sysrq 'b' [RHEL-8])
|
||||
|
||||
* Wed Dec 28 2022 Camilla Conte <cconte@redhat.com> - 22.1-7
|
||||
- ci-Ensure-network-ready-before-cloud-init-service-runs-.patch [bz#2151861]
|
||||
- Resolves: bz#2151861
|
||||
|
|
Loading…
Reference in New Issue