Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20b3ce6

Browse files
liunan-msanphel31
authored andcommittedAug 24, 2022
fix cloud-init dependency issue (microsoft#3606)
1 parent 0d7011c commit 20b3ce6

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed
 

‎SPECS/cloud-init/add-mariner-distro-support.patch

+32-5
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,33 @@ index 6951a0e3..411065f9 100644
359359
# Other config here will be given to the distro class and/or path classes
360360
paths:
361361
cloud_dir: /var/lib/cloud/
362+
diff -ruN a/systemd/cloud-init-local.service.tmpl b/systemd/cloud-init-local.service.tmpl
363+
--- a/systemd/cloud-init-local.service.tmpl 2022-05-18 08:23:24.000000000 -0700
364+
+++ b/systemd/cloud-init-local.service.tmpl 2022-08-23 16:23:57.854218334 -0700
365+
@@ -1,9 +1,7 @@
366+
## template:jinja
367+
[Unit]
368+
Description=Initial cloud-init job (pre-networking)
369+
-{% if variant in ["ubuntu", "unknown", "debian", "rhel" ] %}
370+
DefaultDependencies=no
371+
-{% endif %}
372+
Wants=network-pre.target
373+
After=hv_kvp_daemon.service
374+
After=systemd-remount-fs.service
375+
@@ -21,10 +19,8 @@
376+
Before=firewalld.target
377+
Conflicts=shutdown.target
378+
{% endif %}
379+
-{% if variant in ["ubuntu", "unknown", "debian"] %}
380+
Before=sysinit.target
381+
Conflicts=shutdown.target
382+
-{% endif %}
383+
RequiresMountsFor=/var/lib/cloud
384+
{% if variant == "rhel" %}
385+
ConditionPathExists=!/etc/cloud/cloud-init.disabled
362386
diff -ruN a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
363-
--- a/systemd/cloud-init.service.tmpl 2022-05-18 08:23:24.000000000 -0700
364-
+++ b/systemd/cloud-init.service.tmpl 2022-08-03 21:51:14.862040213 -0700
387+
--- a/systemd/cloud-init.service.tmpl 2022-05-18 08:23:24.000000000 -0700
388+
+++ b/systemd/cloud-init.service.tmpl 2022-08-23 16:21:56.556071614 -0700
365389
@@ -1,7 +1,7 @@
366390
## template:jinja
367391
[Unit]
@@ -371,16 +395,18 @@ diff -ruN a/systemd/cloud-init.service.tmpl b/systemd/cloud-init.service.tmpl
371395
DefaultDependencies=no
372396
{% endif %}
373397
Wants=cloud-init-local.service
374-
@@ -26,8 +26,8 @@
398+
@@ -26,11 +26,9 @@
375399
Before=network-online.target
376400
Before=sshd-keygen.service
377401
Before=sshd.service
378402
-{% if variant in ["ubuntu", "unknown", "debian"] %}
379403
Before=sysinit.target
380-
+{% if variant in ["ubuntu", "unknown", "debian"] %}
381404
Before=shutdown.target
382405
Conflicts=shutdown.target
383-
{% endif %}
406+
-{% endif %}
407+
{% if variant in ["suse"] %}
408+
Before=shutdown.target
409+
Conflicts=shutdown.target
384410
diff --git a/templates/hosts.mariner.tmpl b/templates/hosts.mariner.tmpl
385411
new file mode 100644
386412
index 00000000..2e956382
@@ -768,3 +794,4 @@ index 176df36b..10e47343 100755
768794
--
769795
2.25.1
770796

797+

‎SPECS/cloud-init/cloud-init.spec

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Cloud instance init scripts
22
Name: cloud-init
33
Version: 22.2
4-
Release: 6%{?dist}
4+
Release: 7%{?dist}
55
License: GPLv3
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
@@ -146,6 +146,9 @@ make check %{?_smp_mflags}
146146
%config(noreplace) %{_sysconfdir}/cloud/cloud.cfg.d/10-azure-kvp.cfg
147147

148148
%changelog
149+
* Wed Aug 22 2022 Nan Liu <liunan@microsoft.com> - 22.2-7
150+
- Update add-mariner-distro-support patch to fix cloud-init dependency cycle
151+
149152
* Wed Aug 03 2022 Minghe Ren <mingheren@microsoft.com> - 22.2-6
150153
- Update add-mariner-distro-support patch to add sysinit.target dependency
151154

0 commit comments

Comments
 (0)
Please sign in to comment.