2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-12-04 16:17:06 +00:00
Files
xcat-core/xCAT-server/share/xcat/mypostscript/mypostscript.tmpl
T
Daniel Hilst b5300555a6 fix(xcat-core): an installed KVM node sends a DUID its reservation does not hold
With mac.duid=canonical or firmware, an installed KVM guest whose
domain an earlier mkvm defined sends a DHCPv6 client identifier that
its reservation does not hold.

makedhcp applies the policy to vpd.uuid. configdhcpv6duid applied it to
product_uuid of the node. In such a guest product_uuid is the byte swap
of vpd.uuid, so the script wrote the other UUID order.

mypostscript now exports vpd.uuid as VPDUUID, and configdhcpv6duid
applies the policy to it. The script reads product_uuid only when
VPDUUID holds no UUID.

postscript_dhcpv6_duid.bats asserts the DUID for each policy with a
swapped product_uuid, and the VPDUUID export. The tests fail without
this change.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-11-09 18:19:09 -03:00

198 lines
4.5 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 DHCP6DUID
# makedhcp builds a DUID-UUID from vpd.uuid, so configdhcpv6duid reads the same value.
VPDUUID=#TABLE:vpd:$NODE:uuid#
export VPDUUID
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