Properly configure a default IPMI template during wwctl upgrade nodes --add-defaults

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-03-19 02:20:48 -06:00
parent ea9a013812
commit 06f2c0dc5a
3 changed files with 16 additions and 0 deletions

View File

@@ -122,6 +122,9 @@ func (legacy *NodesYaml) Upgrade(addDefaults bool, replaceOverlays bool, warewul
defaultProfile.RuntimeOverlay = append(
defaultProfile.RuntimeOverlay, genericSplitOverlays...)
}
if defaultProfile.Kernel == nil {
defaultProfile.Kernel = new(node.KernelConf)
}
if len(defaultProfile.Kernel.Args) < 1 {
defaultProfile.Kernel.Args = []string{"quiet", "crashkernel=no"}
}
@@ -153,6 +156,12 @@ func (legacy *NodesYaml) Upgrade(addDefaults bool, replaceOverlays bool, warewul
},
}
}
if defaultProfile.Ipmi == nil {
defaultProfile.Ipmi = new(node.IpmiConf)
}
if defaultProfile.Ipmi.Template == "" {
defaultProfile.Ipmi.Template = "ipmitool.tmpl"
}
}
return upgraded
}

View File

@@ -553,6 +553,8 @@ nodes:
nodeprofiles:
default:
ipxe template: default
ipmi:
template: ipmitool.tmpl
runtime overlay:
- hosts
- ssh.authorized_keys
@@ -634,6 +636,8 @@ nodes:
nodeprofiles:
custom: {}
default:
ipmi:
template: ipmitool.tmpl
ipxe template: default
runtime overlay:
- hosts
@@ -891,6 +895,8 @@ nodeprofiles:
upgradedYaml: `
nodeprofiles:
default:
ipmi:
template: ipmitool.tmpl
ipxe template: default
runtime overlay:
- hosts