diff --git a/SOURCES/0021-azure-ensure-that-networkmanager-hook-script-runs.patch b/SOURCES/0021-azure-ensure-that-networkmanager-hook-script-runs.patch deleted file mode 100644 index e40680f..0000000 --- a/SOURCES/0021-azure-ensure-that-networkmanager-hook-script-runs.patch +++ /dev/null @@ -1,60 +0,0 @@ -From d8618679265a57f4d872bd9972e3abb807db4e15 Mon Sep 17 00:00:00 2001 -From: Lars Kellogg-Stedman -Date: Thu, 15 Jun 2017 12:20:39 -0400 -Subject: [PATCH] azure: ensure that networkmanager hook script runs - -The networkmanager hook script was failing to run due to the changes -we made to resolve rhbz#1440831. This corrects the regression by -allowing the NM hook script to run regardless of whether or not -cloud-init is "enabled". - -Resolves: rhbz#1460206 -X-downstream-only: true ---- - tools/hook-dhclient | 3 +-- - tools/hook-network-manager | 3 +-- - tools/hook-rhel.sh | 3 +-- - 3 files changed, 3 insertions(+), 6 deletions(-) - -diff --git a/tools/hook-dhclient b/tools/hook-dhclient -index 02122f3..181cd51 100755 ---- a/tools/hook-dhclient -+++ b/tools/hook-dhclient -@@ -13,8 +13,7 @@ is_azure() { - } - - is_enabled() { -- # only execute hooks if cloud-init is enabled and on azure -- [ -e /run/cloud-init/enabled ] || return 1 -+ # only execute hooks if cloud-init is running on azure - is_azure - } - -diff --git a/tools/hook-network-manager b/tools/hook-network-manager -index 67d9044..1d52cad 100755 ---- a/tools/hook-network-manager -+++ b/tools/hook-network-manager -@@ -13,8 +13,7 @@ is_azure() { - } - - is_enabled() { -- # only execute hooks if cloud-init is enabled and on azure -- [ -e /run/cloud-init/enabled ] || return 1 -+ # only execute hooks if cloud-init running on azure - is_azure - } - -diff --git a/tools/hook-rhel.sh b/tools/hook-rhel.sh -index 513a551..d75767e 100755 ---- a/tools/hook-rhel.sh -+++ b/tools/hook-rhel.sh -@@ -13,8 +13,7 @@ is_azure() { - } - - is_enabled() { -- # only execute hooks if cloud-init is enabled and on azure -- [ -e /run/cloud-init/enabled ] || return 1 -+ # only execute hooks if cloud-init is running on azure - is_azure - } - diff --git a/SOURCES/0027-systemd-create-run-cloud-init-enabled.patch b/SOURCES/0027-systemd-create-run-cloud-init-enabled.patch new file mode 100644 index 0000000..7b822e6 --- /dev/null +++ b/SOURCES/0027-systemd-create-run-cloud-init-enabled.patch @@ -0,0 +1,29 @@ +From e210660ecaee3b44a6e8b4e0fe39e4055450696e Mon Sep 17 00:00:00 2001 +From: Ryan McCabe +Date: Fri, 10 Nov 2017 10:03:44 -0500 +Subject: [PATCH] Create an explicit enabled file in /run/cloud-init/ to + control whether the dhclient and NM hooks run on Azure. + +X-downstream-only: Yes +Resolves: rhbz#1474226 +--- + rhel/systemd/cloud-init-local.service | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service +index 8174937b..047907c4 100644 +--- a/rhel/systemd/cloud-init-local.service ++++ b/rhel/systemd/cloud-init-local.service +@@ -14,6 +14,9 @@ ConditionKernelCommandLine=!cloud-init=disabled + + [Service] + Type=oneshot ++ExecStartPre=/bin/mkdir -p /run/cloud-init ++ExecStartPre=/sbin/restorecon /run/cloud-init ++ExecStartPre=/usr/bin/touch /run/cloud-init/enabled + ExecStart=/usr/bin/cloud-init init --local + ExecStart=/bin/touch /run/cloud-init/network-config-ready + RemainAfterExit=yes +-- +2.13.6 + diff --git a/SPECS/cloud-init.spec b/SPECS/cloud-init.spec index 5d1f07c..055443b 100644 --- a/SPECS/cloud-init.spec +++ b/SPECS/cloud-init.spec @@ -7,7 +7,7 @@ Name: cloud-init Version: 0.7.9 -Release: 9%{?dist}.1 +Release: 9%{?dist}.2 Summary: Cloud instance init scripts Group: System Environment/Base @@ -42,12 +42,13 @@ Patch0017: 0017-sysconfig-Raise-ValueError-when-multiple-default-gat.patch Patch0018: 0018-Fix-dual-stack-IPv4-IPv6-configuration-for-RHEL.patch Patch0019: 0019-Add-missing-sysconfig-unit-test-data.patch Patch0020: 0020-Fix-ipv6-subnet-detection.patch -Patch0021: 0021-azure-ensure-that-networkmanager-hook-script-runs.patch +#Patch0021: 0021-azure-ensure-that-networkmanager-hook-script-runs.patch Patch0022: 0022-RHEL-CentOS-Fix-default-routes-for-IPv4-IPv6-configu.patch Patch0023: 0023-DatasourceEc2-add-warning-message-when-not-on-AWS.patch Patch0024: 0024-Identify-Brightbox-as-an-Ec2-datasource-user.patch Patch0025: 0025-AliYun-Enable-platform-identification-and-enable-by-.patch Patch0026: 0026-Fix-alibaba-cloud-unit-tests-to-work-with-0.7.9.patch +Patch0027: 0027-systemd-create-run-cloud-init-enabled.patch # Deal with noarch -> arch # https://bugzilla.redhat.com/show_bug.cgi?id=1067089 @@ -183,6 +184,10 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog +* Thu Dec 21 2017 Ryan McCabe 0.7.9-9.2 +- Prevent Azure NM and dhclient hooks from running when cloud-init is + disabled (rhbz#1530127) + * Tue Sep 26 2017 Ryan McCabe 0.7.9-9.1 - Support AliCloud datasource (rhbz#1496113)