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

fix(xcat-core): default Subiquity installnic to match-by-MAC when unset

Resolve installnic with the non-fatal #TABLEBLANKOKAY# token so an absent
noderes.installnic renders blank instead of aborting xnba generation, and treat an
empty installnic exactly like "mac": match the interface by its boot MAC address and
do not rename it. That is the same default EL and SLES already get, since their
statefull templates never reference installnic at all.

Nodes that do set noderes.installnic are unaffected -- the set-name branch is
unchanged. The diskless/netboot path never referenced installnic and is untouched.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-08-24 14:34:21 -03:00
parent f051902173
commit 62ab9caead
@@ -74,11 +74,11 @@ autoinstall:
- mkdir -p /target/var/log/xcat/
- '{
cat /tmp/pre-install.log >> /target/var/log/xcat/xcat.log;
installnic="#TABLE:noderes:$NODE:installnic#";
installnic="#TABLEBLANKOKAY:noderes:$NODE:installnic#";
installmac="#TABLE:mac:$NODE:mac#";
installmac="$(printf ''%s'' "${installmac}" | cut -d''|'' -f1 | cut -d''!'' -f1 | tr ''A-F'' ''a-f'')";
mkdir -p /target/etc/netplan;
if [ "${installnic}" = "mac" ]; then
if [ "${installnic}" = "mac" ] || [ -z "${installnic}" ]; then
printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml;
else
printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " set-name: ${installnic}" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml;