Updated warewulf plugin (still WIP)

This commit is contained in:
David Allen 2024-06-27 11:20:19 -06:00
parent cccbb1ad25
commit 962cf42e79
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -68,12 +68,17 @@ func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (g
return nil, fmt.Errorf("no redfish endpoints found")
}
// format output for template substitution
nodeEntries := ""
// load files and templates and copy to outputs
files, err := generator.LoadFiles(target.FilePaths...)
if err != nil {
return nil, fmt.Errorf("failed to load files: %v", err)
}
templates, err := generator.ApplyTemplates(generator.Mappings{}, target.Templates...)
templates, err := generator.ApplyTemplates(generator.Mappings{
"node_entries": nodeEntries,
}, target.Templates...)
if err != nil {
return nil, fmt.Errorf("failed to load templates: %v", err)
}