From 13ded463a6a0b1b0bf0dffc0a997f006dd25c4f3 Mon Sep 17 00:00:00 2001 From: Emanuele Giuseppe Esposito Date: Thu, 19 May 2022 15:51:27 +0200 Subject: [PATCH 2/4] Use Network-Manager and Netplan as default renderers for RHEL and Fedora (#1465) RH-Author: Emanuele Giuseppe Esposito RH-MergeRequest: 57: Add native NetworkManager support (#1224) RH-Commit: [2/2] f2f977564bea496b0d76c0cef242959d03c2c73e RH-Bugzilla: 2059872 RH-Acked-by: Vitaly Kuznetsov RH-Acked-by: Jon Maloy RH-Acked-by: Eduardo Otubo commit 7703aa98b89c8daba207c28a0422268ead10019a Author: Emanuele Giuseppe Esposito Date: Thu May 19 15:05:01 2022 +0200 Use Network-Manager and Netplan as default renderers for RHEL and Fedora (#1465) This is adapted from Neal Gompa's PR: https://github.com/canonical/cloud-init/pull/1435 The only difference is that we are not modifying renderers.py (thus modifying the priority of all distros), but just tweaking cloud.cfg to apply this change to Fedora and RHEL. Other distros can optionally add themselves afterwards. net: Prefer Netplan and NetworkManager renderers by default NetworkManager is used by default on a variety of Linux distributions, and exists as a cross-distribution network management service. Additionally, add information about the NetworkManager renderer to the cloud-init documentation. Because Netplan can be explicitly used to manage NetworkManager, it needs to be preferred before NetworkManager. This change is a follow-up to #1224, which added the native NetworkManager renderer. This patch has been deployed on Fedora's cloud-init package throughout the development of Fedora Linux 36 to verify that it works. This should also make it tremendously easier for Linux distributions to use cloud-init because now a standard configuration is supported by default. Signed-off-by: Neal Gompa Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Emanuele Giuseppe Esposito --- config/cloud.cfg.tmpl | 3 +++ doc/rtd/topics/network-config.rst | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/config/cloud.cfg.tmpl b/config/cloud.cfg.tmpl index fb4b456c..86beee3c 100644 --- a/config/cloud.cfg.tmpl +++ b/config/cloud.cfg.tmpl @@ -330,4 +330,7 @@ system_info: {% elif variant in ["dragonfly"] %} network: renderers: ['freebsd'] +{% elif variant in ["rhel", "fedora"] %} + network: + renderers: ['netplan', 'network-manager', 'networkd', 'sysconfig', 'eni'] {% endif %} diff --git a/doc/rtd/topics/network-config.rst b/doc/rtd/topics/network-config.rst index c461a3fe..f503caab 100644 --- a/doc/rtd/topics/network-config.rst +++ b/doc/rtd/topics/network-config.rst @@ -188,6 +188,15 @@ generated configuration into an internal network configuration state. From this state `Cloud-init`_ delegates rendering of the configuration to Distro supported formats. The following ``renderers`` are supported in cloud-init: +- **NetworkManager** + +`NetworkManager `_ is the standard Linux network +configuration tool suite. It supports a wide range of networking setups. +Configuration is typically stored in ``/etc/NetworkManager``. + +It is the default for a number of Linux distributions, notably Fedora; +CentOS/RHEL; and derivatives. + - **ENI** /etc/network/interfaces or ``ENI`` is supported by the ``ifupdown`` package @@ -215,6 +224,7 @@ is as follows: - ENI - Sysconfig - Netplan +- NetworkManager When applying the policy, `Cloud-init`_ checks if the current instance has the correct binaries and paths to support the renderer. The first renderer that @@ -223,7 +233,7 @@ supplying an updated configuration in cloud-config. :: system_info: network: - renderers: ['netplan', 'eni', 'sysconfig', 'freebsd', 'netbsd', 'openbsd'] + renderers: ['netplan', 'network-manager', 'eni', 'sysconfig', 'freebsd', 'netbsd', 'openbsd'] Network Configuration Tools -- 2.35.3