From 6428534dc379edd48f1553ba5dcd13498d0193ab Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Thu, 20 Apr 2023 02:50:47 -0600 Subject: [PATCH 1/2] Configure ONBOOT with netdev.OnBoot Closes #644 Signed-off-by: Jonathon Anderson --- CHANGELOG.md | 4 ++++ overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 405996e4..5c68becc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Restrict access to `/warewulf/config` to root only. (#728, #742) - KERNEL VERSION column is too short. #690 - Add support for resolving absolute path automatically. #493 +- The network device "OnBoot" parameter correctly configures the ONBOOT ifcfg + parameter. (#644) ### Changed @@ -34,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 `wwctl --emptyconf genconfig warewulfconf print` for the available paths. - Added experimental dnsmasq support. - Refactored `profile add` command to make it alike `node add`. #658 #659 +- The ifcfg ONBOOT parameter is no longer statically `true`, so unconfigured + interfaces may not be enabled by default. (#644) - new subcommand `wwctl genconf` is available with following subcommands: * `completions` which will create the files used for bash-completion. Also diff --git a/overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww b/overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww index 5de10792..53192fa5 100644 --- a/overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww +++ b/overlays/wwinit/etc/sysconfig/network-scripts/ifcfg.ww @@ -24,7 +24,9 @@ HWADDR={{ $netdev.Hwaddr }} {{ if $netdev.Type -}} TYPE={{ $netdev.Type }} {{ end -}} -ONBOOT=yes +{{ if $netdev.OnBoot -}} +ONBOOT={{ $netdev.OnBoot }} +{{ end -}} IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes From 8b552fe5ca7af61f9c34685e1d687d45c7980ed0 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Fri, 21 Apr 2023 08:38:15 +0200 Subject: [PATCH 2/2] make onboot default for network devices Signed-off-by: Christian Goll --- internal/pkg/node/constructors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/pkg/node/constructors.go b/internal/pkg/node/constructors.go index 0619e912..1b44e454 100644 --- a/internal/pkg/node/constructors.go +++ b/internal/pkg/node/constructors.go @@ -37,7 +37,8 @@ defaultnode: dummy: device: eth0 type: ethernet - netmask: 255.255.255.0` + netmask: 255.255.255.0 + onboot: true` func init() { conf := warewulfconf.New() @@ -61,7 +62,6 @@ func New() (NodeYaml, error) { return Parse(data) } - // Parse constructs a new nodeDb object from an input YAML // document. Passes any errors return from yaml.Unmarshal. Returns an // error if any parsed value is not of a valid type for the given @@ -100,7 +100,6 @@ func Parse(data []byte) (NodeYaml, error) { return ret, nil } - /* Get all the nodes of a configuration. This function also merges the nodes with the given profiles and set the default values