mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 03:27:02 -07:00
Merge pull request #21 from OpenCHAMI/20-convert-plugins
Build default plugins directly into the binary executable
This commit is contained in:
commit
a55ecf2b88
11 changed files with 100 additions and 91 deletions
|
|
@ -5,12 +5,14 @@ before:
|
||||||
- go mod download
|
- go mod download
|
||||||
- make plugins
|
- make plugins
|
||||||
builds:
|
builds:
|
||||||
- env:
|
- id: "configurator"
|
||||||
- CGO_ENABLED=1
|
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- amd64
|
||||||
|
- arm64
|
||||||
|
flags:
|
||||||
|
- -tags:all
|
||||||
archives:
|
archives:
|
||||||
- format: tar.gz
|
- format: tar.gz
|
||||||
# this name template makes the OS and Arch compatible with the results of uname.
|
# this name template makes the OS and Arch compatible with the results of uname.
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,10 +21,10 @@ func (g *Conman) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Conman) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *Conman) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
var (
|
var (
|
||||||
params = generator.GetParams(opts...)
|
params = GetParams(opts...)
|
||||||
client = generator.GetClient(params)
|
client = GetClient(params)
|
||||||
targetKey = params["target"].(string) // required param
|
targetKey = params["target"].(string) // required param
|
||||||
target = config.Targets[targetKey]
|
target = config.Targets[targetKey]
|
||||||
eps []configurator.RedfishEndpoint = nil
|
eps []configurator.RedfishEndpoint = nil
|
||||||
|
|
@ -56,7 +55,7 @@ func (g *Conman) Generate(config *configurator.Config, opts ...util.Option) (gen
|
||||||
consoles += "# ====================================================================="
|
consoles += "# ====================================================================="
|
||||||
|
|
||||||
// apply template substitutions and return output as byte array
|
// apply template substitutions and return output as byte array
|
||||||
return generator.ApplyTemplateFromFiles(generator.Mappings{
|
return ApplyTemplateFromFiles(Mappings{
|
||||||
"plugin_name": g.GetName(),
|
"plugin_name": g.GetName(),
|
||||||
"plugin_version": g.GetVersion(),
|
"plugin_version": g.GetVersion(),
|
||||||
"plugin_description": g.GetDescription(),
|
"plugin_description": g.GetDescription(),
|
||||||
|
|
@ -65,5 +64,3 @@ func (g *Conman) Generate(config *configurator.Config, opts ...util.Option) (gen
|
||||||
"consoles": consoles,
|
"consoles": consoles,
|
||||||
}, target.TemplatePaths...)
|
}, target.TemplatePaths...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Conman
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
package main
|
//go:build coredhcp || plugins
|
||||||
|
// +build coredhcp plugins
|
||||||
|
|
||||||
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,8 +24,6 @@ func (g *CoreDhcp) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s' to generate config files. (WIP)", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s' to generate config files. (WIP)", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *CoreDhcp) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *CoreDhcp) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
return nil, fmt.Errorf("plugin does not implement generation function")
|
return nil, fmt.Errorf("plugin does not implement generation function")
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator CoreDhcp
|
|
||||||
|
|
@ -1,31 +1,30 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Dhcpd struct{}
|
type DHCPd struct{}
|
||||||
|
|
||||||
func (g *Dhcpd) GetName() string {
|
func (g *DHCPd) GetName() string {
|
||||||
return "dhcpd"
|
return "dhcpd"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Dhcpd) GetVersion() string {
|
func (g *DHCPd) GetVersion() string {
|
||||||
return util.GitCommit()
|
return util.GitCommit()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Dhcpd) GetDescription() string {
|
func (g *DHCPd) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Dhcpd) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *DHCPd) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
var (
|
var (
|
||||||
params = generator.GetParams(opts...)
|
params = GetParams(opts...)
|
||||||
client = generator.GetClient(params)
|
client = GetClient(params)
|
||||||
targetKey = params["target"].(string)
|
targetKey = params["target"].(string)
|
||||||
target = config.Targets[targetKey]
|
target = config.Targets[targetKey]
|
||||||
compute_nodes = ""
|
compute_nodes = ""
|
||||||
|
|
@ -64,7 +63,7 @@ func (g *Dhcpd) Generate(config *configurator.Config, opts ...util.Option) (gene
|
||||||
fmt.Printf("")
|
fmt.Printf("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return generator.ApplyTemplateFromFiles(generator.Mappings{
|
return ApplyTemplateFromFiles(Mappings{
|
||||||
"plugin_name": g.GetName(),
|
"plugin_name": g.GetName(),
|
||||||
"plugin_version": g.GetVersion(),
|
"plugin_version": g.GetVersion(),
|
||||||
"plugin_description": g.GetDescription(),
|
"plugin_description": g.GetDescription(),
|
||||||
|
|
@ -72,5 +71,3 @@ func (g *Dhcpd) Generate(config *configurator.Config, opts ...util.Option) (gene
|
||||||
"node_entries": "",
|
"node_entries": "",
|
||||||
}, target.TemplatePaths...)
|
}, target.TemplatePaths...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Dhcpd
|
|
||||||
|
|
@ -1,29 +1,28 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DnsMasq struct{}
|
type DNSMasq struct{}
|
||||||
|
|
||||||
func (g *DnsMasq) GetName() string {
|
func (g *DNSMasq) GetName() string {
|
||||||
return "dnsmasq"
|
return "dnsmasq"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *DnsMasq) GetVersion() string {
|
func (g *DNSMasq) GetVersion() string {
|
||||||
return util.GitCommit()
|
return util.GitCommit()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *DnsMasq) GetDescription() string {
|
func (g *DNSMasq) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *DNSMasq) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
// make sure we have a valid config first
|
// make sure we have a valid config first
|
||||||
if config == nil {
|
if config == nil {
|
||||||
return nil, fmt.Errorf("invalid config (config is nil)")
|
return nil, fmt.Errorf("invalid config (config is nil)")
|
||||||
|
|
@ -31,8 +30,8 @@ func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (ge
|
||||||
|
|
||||||
// set all the defaults for variables
|
// set all the defaults for variables
|
||||||
var (
|
var (
|
||||||
params = generator.GetParams(opts...)
|
params = GetParams(opts...)
|
||||||
client = generator.GetClient(params)
|
client = GetClient(params)
|
||||||
targetKey = params["target"].(string) // required param
|
targetKey = params["target"].(string) // required param
|
||||||
target = config.Targets[targetKey]
|
target = config.Targets[targetKey]
|
||||||
eths []configurator.EthernetInterface = nil
|
eths []configurator.EthernetInterface = nil
|
||||||
|
|
@ -74,12 +73,10 @@ func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (ge
|
||||||
output += "# ====================================================================="
|
output += "# ====================================================================="
|
||||||
|
|
||||||
// apply template substitutions and return output as byte array
|
// apply template substitutions and return output as byte array
|
||||||
return generator.ApplyTemplateFromFiles(generator.Mappings{
|
return ApplyTemplateFromFiles(Mappings{
|
||||||
"plugin_name": g.GetName(),
|
"plugin_name": g.GetName(),
|
||||||
"plugin_version": g.GetVersion(),
|
"plugin_version": g.GetVersion(),
|
||||||
"plugin_description": g.GetDescription(),
|
"plugin_description": g.GetDescription(),
|
||||||
"dhcp-hosts": output,
|
"dhcp-hosts": output,
|
||||||
}, target.TemplatePaths...)
|
}, target.TemplatePaths...)
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator DnsMasq
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
package main
|
//go:build example || plugins
|
||||||
|
// +build example plugins
|
||||||
|
|
||||||
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
@ -14,28 +14,45 @@ import (
|
||||||
"github.com/nikolalohinski/gonja/v2/exec"
|
"github.com/nikolalohinski/gonja/v2/exec"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mappings map[string]any
|
type (
|
||||||
type FileMap map[string][]byte
|
Mappings map[string]any
|
||||||
type FileList [][]byte
|
FileMap map[string][]byte
|
||||||
type Template []byte
|
FileList [][]byte
|
||||||
|
Template []byte
|
||||||
|
|
||||||
// Generator interface used to define how files are created. Plugins can
|
// Generator interface used to define how files are created. Plugins can
|
||||||
// be created entirely independent of the main driver program.
|
// be created entirely independent of the main driver program.
|
||||||
type Generator interface {
|
Generator interface {
|
||||||
GetName() string
|
GetName() string
|
||||||
GetVersion() string
|
GetVersion() string
|
||||||
GetDescription() string
|
GetDescription() string
|
||||||
Generate(config *configurator.Config, opts ...util.Option) (FileMap, error)
|
Generate(config *configurator.Config, opts ...util.Option) (FileMap, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Params defined and used by the "generate" subcommand.
|
// Params defined and used by the "generate" subcommand.
|
||||||
type Params struct {
|
Params struct {
|
||||||
Args []string
|
Args []string
|
||||||
Generators map[string]Generator
|
TemplatePaths []string
|
||||||
TemplatePaths []string
|
PluginPath string
|
||||||
PluginPath string
|
Target string
|
||||||
Target string
|
Verbose bool
|
||||||
Verbose bool
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
var DefaultGenerators = createDefaultGenerators()
|
||||||
|
|
||||||
|
func createDefaultGenerators() map[string]Generator {
|
||||||
|
var (
|
||||||
|
generatorMap = map[string]Generator{}
|
||||||
|
generators = []Generator{
|
||||||
|
&Conman{}, &DHCPd{}, &DNSMasq{}, &Hostfile{},
|
||||||
|
&Powerman{}, &Syslog{}, &Warewulf{},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
for _, g := range generators {
|
||||||
|
generatorMap[g.GetName()] = g
|
||||||
|
}
|
||||||
|
return generatorMap
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converts the file outputs from map[string][]byte to map[string]string.
|
// Converts the file outputs from map[string][]byte to map[string]string.
|
||||||
|
|
@ -397,6 +414,10 @@ func GenerateWithTarget(config *configurator.Config, params Params) (FileMap, er
|
||||||
configurator.WithAccessToken(config.AccessToken),
|
configurator.WithAccessToken(config.AccessToken),
|
||||||
configurator.WithCertPoolFile(config.CertPath),
|
configurator.WithCertPoolFile(config.CertPath),
|
||||||
)
|
)
|
||||||
|
target configurator.Target
|
||||||
|
generator Generator
|
||||||
|
err error
|
||||||
|
ok bool
|
||||||
)
|
)
|
||||||
|
|
||||||
// check if a target is supplied
|
// check if a target is supplied
|
||||||
|
|
@ -405,7 +426,7 @@ func GenerateWithTarget(config *configurator.Config, params Params) (FileMap, er
|
||||||
}
|
}
|
||||||
|
|
||||||
// load target information from config
|
// load target information from config
|
||||||
target, ok := config.Targets[params.Target]
|
target, ok = config.Targets[params.Target]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("target not found in config")
|
return nil, fmt.Errorf("target not found in config")
|
||||||
}
|
}
|
||||||
|
|
@ -415,10 +436,14 @@ func GenerateWithTarget(config *configurator.Config, params Params) (FileMap, er
|
||||||
target.PluginPath = params.PluginPath
|
target.PluginPath = params.PluginPath
|
||||||
}
|
}
|
||||||
|
|
||||||
// only load the plugin needed for this target
|
// check if generator is built-in first before loading
|
||||||
generator, err := LoadPlugin(target.PluginPath)
|
generator, ok = DefaultGenerators[params.Target]
|
||||||
if err != nil {
|
if !ok {
|
||||||
return nil, fmt.Errorf("failed to load plugin: %w", err)
|
// only load the plugin needed for this target if we don't find default
|
||||||
|
generator, err = LoadPlugin(target.PluginPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to load plugin: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// run the generator plugin from target passed
|
// run the generator plugin from target passed
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,8 +21,6 @@ func (g *Hostfile) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Hostfile) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *Hostfile) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
return nil, fmt.Errorf("plugin does not implement generation function")
|
return nil, fmt.Errorf("plugin does not implement generation function")
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Hostfile
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,8 +21,6 @@ func (g *Powerman) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Powerman) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *Powerman) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
return nil, fmt.Errorf("plugin does not implement generation function")
|
return nil, fmt.Errorf("plugin does not implement generation function")
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Powerman
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,8 +21,6 @@ func (g *Syslog) GetDescription() string {
|
||||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Syslog) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *Syslog) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
return nil, fmt.Errorf("plugin does not implement generation function")
|
return nil, fmt.Errorf("plugin does not implement generation function")
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Syslog
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package generator
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
configurator "github.com/OpenCHAMI/configurator/pkg"
|
configurator "github.com/OpenCHAMI/configurator/pkg"
|
||||||
"github.com/OpenCHAMI/configurator/pkg/generator"
|
|
||||||
"github.com/OpenCHAMI/configurator/pkg/util"
|
"github.com/OpenCHAMI/configurator/pkg/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -24,13 +23,13 @@ func (g *Warewulf) GetDescription() string {
|
||||||
return "Configurator generator plugin for 'warewulf' config files."
|
return "Configurator generator plugin for 'warewulf' config files."
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (generator.FileMap, error) {
|
func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (FileMap, error) {
|
||||||
var (
|
var (
|
||||||
params = generator.GetParams(opts...)
|
params = GetParams(opts...)
|
||||||
client = generator.GetClient(params)
|
client = GetClient(params)
|
||||||
targetKey = params["target"].(string)
|
targetKey = params["target"].(string)
|
||||||
target = config.Targets[targetKey]
|
target = config.Targets[targetKey]
|
||||||
outputs = make(generator.FileMap, len(target.FilePaths)+len(target.TemplatePaths))
|
outputs = make(FileMap, len(target.FilePaths)+len(target.TemplatePaths))
|
||||||
)
|
)
|
||||||
|
|
||||||
// check if our client is included and is valid
|
// check if our client is included and is valid
|
||||||
|
|
@ -72,11 +71,11 @@ func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (g
|
||||||
nodeEntries := ""
|
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 := 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.ApplyTemplateFromFiles(generator.Mappings{
|
templates, err := ApplyTemplateFromFiles(Mappings{
|
||||||
"node_entries": nodeEntries,
|
"node_entries": nodeEntries,
|
||||||
}, target.TemplatePaths...)
|
}, target.TemplatePaths...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -98,5 +97,3 @@ func (g *Warewulf) Generate(config *configurator.Config, opts ...util.Option) (g
|
||||||
|
|
||||||
return outputs, err
|
return outputs, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var Generator Warewulf
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue