enable grub boot for all nodes

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2023-07-25 15:19:16 +02:00
committed by Jonathon Anderson
parent 03ef7447e9
commit 60dc8f6251
8 changed files with 191 additions and 39 deletions

View File

@@ -34,6 +34,7 @@ type TemplateStruct struct {
Tftp warewulfconf.TFTPConf
Paths warewulfconf.BuildConfig
AllNodes []node.NodeInfo
ProfileMap map[string]*node.NodeInfo
node.NodeConf
// backward compatiblity
Container string
@@ -49,19 +50,19 @@ func InitStruct(nodeInfo *node.NodeInfo) TemplateStruct {
controller := warewulfconf.Get()
nodeDB, err := node.New()
if err != nil {
wwlog.Error("%s", err)
os.Exit(1)
wwlog.Warn("Problems opening nodes.conf: %s", err)
}
allNodes, err := nodeDB.FindAllNodes()
tstruct.AllNodes, err = nodeDB.FindAllNodes()
if err != nil {
wwlog.Error("%s", err)
os.Exit(1)
wwlog.Warn("couldn't get all nodes: %s", err)
}
tstruct.ProfileMap, err = nodeDB.MapAllProfiles()
if err != nil {
wwlog.Warn("couldn't get all profiles: %s", err)
}
// init some convenience vars
tstruct.Id = nodeInfo.Id.Get()
tstruct.Hostname = nodeInfo.Id.Get()
// Backwards compatibility for templates using "Keys"
tstruct.AllNodes = allNodes
tstruct.Nfs = *controller.NFS
tstruct.Dhcp = *controller.DHCP
tstruct.Tftp = *controller.TFTP