A bunch of changes around DHCP service, templating, and controller config

This commit is contained in:
Gregory Kurtzer
2020-12-01 17:31:37 -08:00
parent e227e130fb
commit 056e8c9969
9 changed files with 132 additions and 67 deletions

View File

@@ -147,11 +147,14 @@ func (self *nodeYaml) FindAllControllers() ([]ControllerInfo, error) {
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 string
Secure bool
StartCmd string
RestartCmd string
EnableCmd string
@@ -182,6 +185,16 @@ func (self *nodeYaml) FindAllControllers() ([]ControllerInfo, error) {
}
}(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)