2022-05-31 18:24:07 +00:00
|
|
|
From ffa647e83efd4293bd027e9e390274aad8a12d94 Mon Sep 17 00:00:00 2001
|
2022-05-26 05:09:09 +00:00
|
|
|
From: Eduardo Otubo <otubo@redhat.com>
|
|
|
|
Date: Fri, 7 May 2021 13:36:13 +0200
|
|
|
|
Subject: include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
|
|
|
|
|
|
RH-Author: Eduardo Otubo <otubo@redhat.com>
|
|
|
|
Message-id: <20190320114559.23708-1-otubo@redhat.com>
|
|
|
|
Patchwork-id: 84937
|
|
|
|
O-Subject: [RHEL-7.7 cloud-init PATCH] include 'NOZEROCONF=yes' in /etc/sysconfig/network
|
|
|
|
Bugzilla: 1653131
|
|
|
|
RH-Acked-by: Cathy Avery <cavery@redhat.com>
|
|
|
|
RH-Acked-by: Mohammed Gamal <mgamal@redhat.com>
|
|
|
|
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
|
|
|
|
|
|
The option NOZEROCONF=yes is not included by default in
|
|
|
|
/etc/sysconfig/network, which is required by Overcloud instances. The
|
|
|
|
patch also includes tests for the modifications.
|
|
|
|
|
|
|
|
X-downstream-only: yes
|
|
|
|
Resolves: rhbz#1653131
|
|
|
|
|
|
|
|
Signed-off-by: Eduardo Otubo <otubo@redhat.com>
|
|
|
|
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
|
---
|
2022-05-31 18:24:07 +00:00
|
|
|
cloudinit/net/sysconfig.py | 11 ++++++++++-
|
|
|
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
2022-05-26 05:09:09 +00:00
|
|
|
|
|
|
|
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
|
2022-05-31 18:24:07 +00:00
|
|
|
index e06ddee7..362e8d19 100644
|
2022-05-26 05:09:09 +00:00
|
|
|
--- a/cloudinit/net/sysconfig.py
|
|
|
|
+++ b/cloudinit/net/sysconfig.py
|
2022-05-31 18:24:07 +00:00
|
|
|
@@ -1038,7 +1038,16 @@ class Renderer(renderer.Renderer):
|
2022-05-26 05:09:09 +00:00
|
|
|
# Distros configuring /etc/sysconfig/network as a file e.g. Centos
|
2022-05-31 18:24:07 +00:00
|
|
|
if sysconfig_path.endswith("network"):
|
2022-05-26 05:09:09 +00:00
|
|
|
util.ensure_dir(os.path.dirname(sysconfig_path))
|
2022-05-31 18:24:07 +00:00
|
|
|
- netcfg = [_make_header(), "NETWORKING=yes"]
|
2022-05-26 05:09:09 +00:00
|
|
|
+ netcfg = []
|
2022-05-31 18:24:07 +00:00
|
|
|
+ for line in util.load_file(sysconfig_path, quiet=True).split("\n"):
|
|
|
|
+ if "cloud-init" in line:
|
2022-05-26 05:09:09 +00:00
|
|
|
+ break
|
2022-05-31 18:24:07 +00:00
|
|
|
+ if not line.startswith(("NETWORKING=",
|
|
|
|
+ "IPV6_AUTOCONF=",
|
|
|
|
+ "NETWORKING_IPV6=")):
|
2022-05-26 05:09:09 +00:00
|
|
|
+ netcfg.append(line)
|
|
|
|
+ # Now generate the cloud-init portion of sysconfig/network
|
2022-05-31 18:24:07 +00:00
|
|
|
+ netcfg.extend([_make_header(), "NETWORKING=yes"])
|
2022-05-26 05:09:09 +00:00
|
|
|
if network_state.use_ipv6:
|
2022-05-31 18:24:07 +00:00
|
|
|
netcfg.append("NETWORKING_IPV6=yes")
|
|
|
|
netcfg.append("IPV6_AUTOCONF=no")
|
2022-05-26 05:09:09 +00:00
|
|
|
--
|
2022-05-31 18:24:07 +00:00
|
|
|
2.31.1
|
2022-05-26 05:09:09 +00:00
|
|
|
|