Changing node.conf structure and moved controllers out of this config

This commit is contained in:
Gregory Kurtzer
2020-12-03 17:26:51 -08:00
parent 84bf9fbb43
commit ec037228cc
4 changed files with 13 additions and 169 deletions

View File

@@ -131,71 +131,6 @@ func (self *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
return ret, nil
}
/*
func (self *nodeYaml) FindAllControllers() ([]ControllerConf, error) {
var ret []ControllerConf
for controllername, controller := range self.Controllers {
var c ControllerConf
c.Id = controllername
c.Ipaddr = controller.Ipaddr
c.Comment = controller.Comment
c.Fqdn = controller.Fqdn
//TODO: Is there a better way to do this, cause EWWW!
c.Services = struct {
Warewulfd struct {
Port string
Secure bool
StartCmd string
RestartCmd string
EnableCmd string
}
Dhcp struct {
Enabled bool
Template string
RangeStart string
RangeEnd string
ConfigFile string
StartCmd string
RestartCmd string
EnableCmd string
}
Tftp struct {
Enabled bool
TftpRoot string
StartCmd string
RestartCmd string
EnableCmd string
}
Nfs struct {
Enabled bool
Exports []string
StartCmd string
RestartCmd string
EnableCmd string
}
}(controller.Services)
// Validations //
if c.Ipaddr == "" {
wwlog.Printf(wwlog.WARN, "Controller IP address is unset: %s\n", c.Id)
}
if c.Services.Warewulfd.Port == "" {
c.Services.Warewulfd.Port = "987"
}
// TODO: Validate or die on all inputs
ret = append(ret, c)
}
return ret, nil
}
*/
func (self *nodeYaml) FindAllProfiles() ([]NodeInfo, error) {
var ret []NodeInfo