From ace5bbf3f4613da6edf3b739bbb4b91287c5618b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Sun, 23 Jan 2022 23:49:21 +0100 Subject: [PATCH] dhcp-all-interfaces: let NetworkManager doit. Override the default for DIB_DHCP_NETWORK_MANAGER_AUTO to `true` on RHEL and CentOS release 8 and later. The dhcp-all-interfaces element is configured to only apply NetworkManager configuration. The service: dhcp-all-interfaces will not be enabled. Not enabling the service allows NetworkManager to do the interface auto- configuration. In release 8 and later it should do this just as good, or even better, compared to the dhcp-all-interfaces.sh script. Depends-On: Id6f8d6aaaf52a78175bb6c065ec88274c364834e Change-Id: I12950733bfe54cae62d299b4c5987449d551857a (cherry picked from commit bdb387bb84e0bbb3f7de79814c39fa0d42d52908) --- .../environment.d/20-ipa-distro-family.bash | 4 ++++ ...s-rhel-centos-relese-gt-7-0c2054d0067c6e93.yaml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 releasenotes/notes/network-manager-auto-dhcp-all-interfaces-rhel-centos-relese-gt-7-0c2054d0067c6e93.yaml diff --git a/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash b/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash index 5b9151e..1d96b91 100644 --- a/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash +++ b/dib/ironic-python-agent-ramdisk/environment.d/20-ipa-distro-family.bash @@ -5,6 +5,10 @@ else export IPA_DISTRO_FAMILY=other fi +if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE%-stream} > 7 ]]; then + export DIB_DHCP_NETWORK_MANAGER_AUTO=${DIB_DHCP_NETWORK_MANAGER_AUTO:-true} +fi + # NOTE(rpittau) force Python version to 3 for debian if [[ $DISTRO_NAME =~ debian ]]; then DIB_PYTHON_VERSION=3 diff --git a/releasenotes/notes/network-manager-auto-dhcp-all-interfaces-rhel-centos-relese-gt-7-0c2054d0067c6e93.yaml b/releasenotes/notes/network-manager-auto-dhcp-all-interfaces-rhel-centos-relese-gt-7-0c2054d0067c6e93.yaml new file mode 100644 index 0000000..9da1e33 --- /dev/null +++ b/releasenotes/notes/network-manager-auto-dhcp-all-interfaces-rhel-centos-relese-gt-7-0c2054d0067c6e93.yaml @@ -0,0 +1,14 @@ +--- +other: + - | + On RHEL and CentOS 8 and later the *dhcp-all-interfaces* diskimage-builder + element is now configured to only apply NetworkManager configuration by + default. The *dhcp-all-interfaces* service will not be enabled. + To re-enable the *dhcp-all-interfaces* service, set + ``DIB_DHCP_NETWORK_MANAGER_AUTO=false`` in the environment. + + NetworkManager is quite capable to do automatic interface configuration. + NetworkManager will by default try to auto-configure any interface with + no configuration, it will use DHCP for IPv4 and Router Advertisements to + decide how to initialize IPv6. +