Updated warewulf plugin (still WIP)
This commit is contained in:
parent
cccbb1ad25
commit
962cf42e79
1 changed files with 6 additions and 1 deletions
|
|
@ -68,12 +68,17 @@ func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (g
|
||||||
return nil, fmt.Errorf("no redfish endpoints found")
|
return nil, fmt.Errorf("no redfish endpoints found")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// format output for template substitution
|
||||||
|
nodeEntries := ""
|
||||||
|
|
||||||
// load files and templates and copy to outputs
|
// load files and templates and copy to outputs
|
||||||
files, err := generator.LoadFiles(target.FilePaths...)
|
files, err := generator.LoadFiles(target.FilePaths...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to load files: %v", err)
|
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 {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to load templates: %v", err)
|
return nil, fmt.Errorf("failed to load templates: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue