xcat-core
xcat-core copied to clipboard
xcatprobe xcatmn does not work for netplan based hosts such as ubuntu 20/22
The is_static_ip function here:
https://github.com/xcat2/xcat-core/blob/master/xCAT-probe/lib/perl/probe_utils.pm#L175
Does not properly detect if a node is using netplan and as such the ubuntu section fails to detect the status of how the interface is configured. if you add this snippet at line 199, it works properly:
`which netplan > /dev/null 2>&1`;
unless ($?) {
my $dhcp_status = `netplan get ethernets.$nic.dhcp4 2>&1`;
unless ($?) {
$rst = 1 if ( $dhcp_status =~ /false/);
return $rst;
}
}