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