sailesh1993 / rpms / cloud-init

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