2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-19 17:02:15 +00:00
Files
xcat-core/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl
T
Daniel Hilst 102dc80920 fix(postscripts): an installed node ignores the DUID its reservation holds
configdhcpv6duid always derived the DHCPv6 client identifier from the SMBIOS
UUID in firmware byte order. makedhcp does that only when mac.duid is unset or
holds 'firmware': 'canonical' reserves the order product_uuid prints, and a
literal DUID is reserved as it stands. A node with either setting wrote an
identifier that matched no reservation, so it took a pool address and had no
boot file URL.

mypostscript.tmpl now exports the attribute as DHCP6DUID, and the postscript
reads it. 'canonical' keeps the order product_uuid printed. A literal is
written as it stands for NetworkManager, which takes a whole DUID.
systemd-networkd composes one from a named type, and only the UUID type can be
expressed that way, so a literal of another type is written for
NetworkManager alone and the reason is logged. A value that is neither keyword
nor DUID writes nothing, which is what makedhcp refuses as well.

The derived values are byte-identical to kea_duid_from_uuid for both orders.
postscript_dhcpv6_duid.bats goes from 9 checks to 16; ignoring the attribute
fails the five that name a setting and leaves the firmware default passing.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-10-30 13:17:39 -03:00

194 lines
4.4 KiB
Cheetah

## beginning of all attributes from the site table
#SITE_TABLE_ALL_ATTRIBS_EXPORT#
## end of all attributes from the site table
ENABLESSHBETWEENNODES=$ENABLESSHBETWEENNODES
export ENABLESSHBETWEENNODES
ZONENAME=$ZONENAME
export ZONENAME
## tabdump(<TABLENAME>) is used to get all the information
## in the <TABLENAME> table
## The <TABLENAME> should only be non-"node key" table
## and two keys table, such as networks, passwd.
## <TABLENAME> should not be site, auditlog or eventlog.
## if the key in the table is a node,
## you should use #TABLE...# instead of tabdump(). See #TABLE below.
## tabdump (networks)
tabdump(networks)
NODE=$NODE
export NODE
#get compute node ip address
IPADDR=#IPADDR#
export IPADDR
# get GROUP list
GROUP=#TABLE:nodelist:$NODE:groups#
export GROUP
## This is the syntax to get the value of one attribute from the
## <tablename> and its key is $NODE.
## It doesn't support the cases where the table has 2 keys.
## nfsserver,installnic,primarynic,routenames from the noderes tab
NFSSERVER=#TABLE:noderes:$NODE:nfsserver#
export NFSSERVER
INSTALLNIC=#TABLE:noderes:$NODE:installnic#
export INSTALLNIC
PRIMARYNIC=#TABLE:noderes:$NODE:primarynic#
export PRIMARYNIC
MASTER=#TABLE:noderes:$NODE:xcatmaster#
# The DHCPv6 client identifier that the reservation of this node holds, so
# configdhcpv6duid writes the one makedhcp reserved rather than deriving another.
DHCP6DUID=#TABLE:mac:$NODE:duid#
export MASTER
SERVICEGROUP=#TABLE:noderes:$NODE:servicenode#
export SERVICEGROUP
SYSLOG=#TABLE:noderes:$NODE:syslog#
export SYSLOG
NODEROUTENAMES=#TABLE:noderes:$NODE:routenames#
export NODEROUTENAMES
MASTER_IP=#MASTER_IP_ADDR#
export MASTER_IP
#ROUTES_VARS_EXPORT#
## osver, arch, profile export
OSVER=#TABLE:nodetype:$NODE:os#
export OSVER
ARCH=#TABLE:nodetype:$NODE:arch#
export ARCH
PROFILE=#TABLE:nodetype:$NODE:profile#
export PROFILE
PROVMETHOD=#TABLE:nodetype:$NODE:provmethod#
export PROVMETHOD
## add current directory to the path
PATH=`dirname $0`:$PATH
export PATH
## AIXX root password related items. AIX root password may not be configured.
## There may be no information.
#AIX_ROOT_PW_VARS_EXPORT#
NODESETSTATE=$NSETSTATE
export NODESETSTATE
UPDATENODE=0
export UPDATENODE
NTYPE=$NTYPE
export NTYPE
MACMAC=#TABLE:mac:$NODE:mac#
export MACMAC
MACADDRESS=$MACADDRESS
export MACADDRESS
## vlan related items. vlan may not be configured.
#VLAN_VARS_EXPORT#
## get monitoring server and other configuration data for monitoring setup on nodes. This may not be configured.
#MONITORING_VARS_EXPORT#
## get the osimage related variables, such as ospkgdir, ospkgs ...
#OSIMAGE_VARS_EXPORT#
## get the diskless networks information. There may be no information.
#NETWORK_FOR_DISKLESS_EXPORT#
## get the kitcomponent deploy parameters. There maybe no information.
#KITCOMP_DEPLOY_PARAMS_EXPORT#
## NIC related attributes for the node for confignics postscript
## There may be no information
NICNODE=#TABLE:nics:$NODE:node#
export NICNODE
NICIPS=#TABLE:nics:$NODE:nicips#
export NICIPS
NICHOSTNAMESUFFIXES=#TABLE:nics:$NODE:nichostnamesuffixes#
export NICHOSTNAMESUFFIXES
NICTYPES=#TABLE:nics:$NODE:nictypes#
export NICTYPES
NICCUSTOMSCRIPTS=#TABLE:nics:$NODE:niccustomscripts#
export NICCUSTOMSCRIPTS
NICNETWORKS=#TABLE:nics:$NODE:nicnetworks#
export NICNETWORKS
NICEXTRAPARAMS=#TABLE:nics:$NODE:nicextraparams#
export NICEXTRAPARAMS
NICDEVICES=#TABLE:nics:$NODE:nicdevices#
export NICDEVICES
CFGMGR=#TABLE:cfgmgt:$NODE:cfgmgr#
export CFGMGR
CFGSERVER=#TABLE:cfgmgt:$NODE:cfgserver#
export CFGSERVER
## Switch relate attributes for this node
SWITCHNAME=#TABLE:switches:$NODE:switch#
export SWITCHNAME
SNMPVERSION=#TABLE:switches:$NODE:snmpversion#
export SNMPVERSION
SNMPUSER=#TABLE:switches:$NODE:username#
export SNMPUSER
SNMPPASSWD=#TABLE:switches:$NODE:password#
export SNMPPASSWD
SNMPPRIV=#TABLE:switches:$NODE:privacy#
export SNMPPRIV
SNMPAUTH=#TABLE:switches:$NODE:auth#
export SNMPAUTH
#CFGMGTINFO_EXPORT#
#INCLUDE:/opt/xcat/share/xcat/mypostscript/mypostscript_cloud.tmpl#
##
##The line postscripts-start-here must not be deleted.
# postscripts-start-here
#INCLUDE_POSTSCRIPTS_LIST#
##The line postscripts-end-here must not be deleted.
# postscripts-end-here
## The line postbootscripts-start-here must not be deleted.
# postbootscripts-start-here
#INCLUDE_POSTBOOTSCRIPTS_LIST#
## The line postbootscripts-end-here must not be deleted.
# postbootscripts-end-here