Use systemd-networkd for debian
Moving from networking to systemd-networkd for debian Original networking is not capable to natively manage down/up on interfaces that is necessary for rescue Change-Id: Ia6e2f217bd3222641cc1c97931e776e7fb717755
This commit is contained in:
parent
612ce753c5
commit
112157b1a9
@ -7,6 +7,7 @@ set -eu
|
||||
set -o pipefail
|
||||
|
||||
DIB_IPA_ENABLE_RESCUE=${DIB_IPA_ENABLE_RESCUE:-true}
|
||||
DIB_IPA_ENABLE_SYSTEMD_NETWORKD=${DIB_IPA_ENABLE_SYSTEMD_NETWORKD:-true}
|
||||
|
||||
if $DIB_IPA_ENABLE_RESCUE; then
|
||||
# Make sure rescue works
|
||||
@ -42,6 +43,24 @@ case "$DIB_INIT_SYSTEM" in
|
||||
systemctl disable dnf-makecache.timer
|
||||
fi
|
||||
fi
|
||||
|
||||
# NOTE(drannou) debian by default is using networking instead of
|
||||
# systemd-networkd. In some usecase like rescue, we need IPA to
|
||||
# re-launch dhclient when modifications are made on the interface.
|
||||
# The easiest way to manage that is to activate systemd-networkd.
|
||||
if $DIB_IPA_ENABLE_SYSTEMD_NETWORKD; then
|
||||
if [[ $DISTRO_NAME =~ debian ]] ; then
|
||||
rm /etc/network/interfaces
|
||||
rm -rf /etc/network/interfaces.d
|
||||
echo "[Match]
|
||||
Name=en*
|
||||
|
||||
[Network]
|
||||
DHCP=yes" > /etc/systemd/network/99-dhcp.network
|
||||
|
||||
systemctl enable systemd-networkd
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
sysv)
|
||||
update-rc.d iptables disable
|
||||
|
Loading…
x
Reference in New Issue
Block a user