mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-19 17:02:15 +00:00
f05677d173
An IPv6-only provisioning network cannot deploy a node. The discovery and credential callbacks open IPv4 sockets, the kickstart and boot templates render an IPv4 address into every endpoint, and makehosts drops an IPv6 value because hosts.pm gates on isIpv4addr. NetworkUtils gains the address helpers the rest of the change uses: format_host_port, parse_host_port and format_uri_host bracket an IPv6 literal, getNodeNetworkCfg6 reads the static IPv6 configuration of a node, my_ip_facing_family selects the management-node address of one family, getIPv6ReverseZone builds a nibble-aligned reverse zone, and node_is_ipv6_only and ipv6_server_for_node answer the two questions the plugins used to answer for themselves. credentials.pm opens the callback socket through IO::Socket::INET6 when the modules are present and keeps the IPv4 path when they are not. Template.pm and anaconda.pm render an IPv6 kickstart network line and bracketed endpoints. The postscripts and the stateless xcatroot format every endpoint through the bracketing helpers. xCAT-server requires perl-IO-Socket-INET6 and perl-Socket6 on EL, and libio-socket-inet6-perl and libsocket6-perl on Debian. (cherry picked from commits c0a69bb5a and caa8ca790) Ported onto upstream masteree6b4f532. The two commits are folded because the second refactors the first. Master is kept where it has a newer form of the same thing: the getipaddr cache guard, the Kea control_socket_path helper, the netboot method list, install_device_params, the modern_installer test and the isValidIp validator, which replaces the isValidIPAddress this branch added. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> (cherry picked from commit3928c04507)
45 lines
1.1 KiB
Awk
Executable File
45 lines
1.1 KiB
Awk
Executable File
#!/usr/bin/awk -f
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
BEGIN {
|
|
xcatdhost = ARGV[1]
|
|
xcatdport = ARGV[2]
|
|
flag = ARGV[3]
|
|
|
|
if (!flag) flag = "next"
|
|
|
|
if (xcatdhost ~ /^\[.*\]$/) {
|
|
sub(/^\[/, "", xcatdhost)
|
|
sub(/\]$/, "", xcatdhost)
|
|
}
|
|
netfamily = index(xcatdhost, ":") ? "inet6" : "inet"
|
|
ns = "/" netfamily "/tcp/0/" xcatdhost "/" xcatdport
|
|
|
|
loop = 0
|
|
while(1) {
|
|
if((ns |& getline) > 0)
|
|
print $0 | "logger -t xcat -p local4.info"
|
|
else {
|
|
print "Retrying flag update" | "logger -t xcat -p local4.info"
|
|
print "updateflag.awk: Retrying flag update" >> "/var/log/xcat/xcat.log"
|
|
close(ns)
|
|
system("sleep 10")
|
|
loop = loop + 1
|
|
}
|
|
|
|
if($0 == "ready")
|
|
print flag |& ns
|
|
if($0 == "done")
|
|
break
|
|
if(loop > 10) {
|
|
print "flag update failed" | "logger -t xcat -p local4.info"
|
|
print "updateflag.awk: flag update failed" >> "/var/log/xcat/xcat.log"
|
|
break
|
|
}
|
|
}
|
|
|
|
close(ns)
|
|
|
|
exit 0
|
|
}
|