Files
warewulf/internal/pkg/config/dhcp.go
Jonathon Anderson e80c639b11 Convert config to *bool
Supports leaving booleans unspecified in YAML.

Boolean methods allow the templates to continue using previous names for
boolean values.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2024-11-11 00:09:48 -07:00

20 lines
569 B
Go

package config
import (
"github.com/warewulf/warewulf/internal/pkg/util"
)
// DHCPConf represents the configuration for the DHCP service that
// Warewulf will configure.
type DHCPConf struct {
EnabledP *bool `yaml:"enabled,omitempty" default:"true"`
Template string `yaml:"template,omitempty" default:"default"`
RangeStart string `yaml:"range start,omitempty"`
RangeEnd string `yaml:"range end,omitempty"`
SystemdName string `yaml:"systemd name,omitempty" default:"dhcpd"`
}
func (this DHCPConf) Enabled() bool {
return util.BoolP(this.EnabledP)
}