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