2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00

fix(configeth): netplan leaves the NIC down during provisioning

configeth's netplan arm took the interface down on every reconfigure, but the
`netplan_apply` that brings it back is gated on reboot_nic_bool. During the
diskful provision postscripts stage reboot_nic_bool is 0, so the link went down
and stayed down until the node rebooted -- and it is the install NIC the
postscripts are still talking over.

Gate the down on reboot_nic_bool as well, so the two halves are paired the way
the redhat arm already pairs them. Nothing is lost by skipping it: the drop-in
is written either way and takes effect at boot, which is the same reasoning the
existing comment gives for skipping the apply.

The ifupdown arm is deliberately left alone -- it answers its `ifdown` with an
unconditional `ifup`, so it never leaves the link down.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-09-01 18:45:55 -03:00
parent 2a5463659b
commit 2390a17faa
+6 -1
View File
@@ -1598,7 +1598,12 @@ else
if [ $bool_restart_flag -eq 1 ];then
if [ "$str_nic_status" = "up" ];then
if [ "$str_os_type" = "debian" ] && [ "$netplan_active" = "1" ];then
ip link set dev $str_nic_name down > /dev/null 2>/dev/null
#the netplan_apply that brings the link back is gated on reboot_nic_bool,
#so taking it down here ungated leaves the NIC down until the next reboot
#in the provision postscripts stage -- over the NIC we are talking on.
if [ $reboot_nic_bool -eq 1 ]; then
ip link set dev $str_nic_name down > /dev/null 2>/dev/null
fi
elif [ "$str_os_type" = "debian" ];then
ifdown --force $str_nic_name > /dev/null
else