Split overlays into discrete functionality and test

- Closes #987

To make the overlays testable in isolation, and after discussion with
the TSC, removed host/time/source from overlay files.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-07-15 16:27:49 -06:00
parent b150b6319e
commit 053dd9953a
109 changed files with 3581 additions and 232 deletions

View File

@@ -0,0 +1,2 @@
[device]
keep-configuration=no

View File

@@ -0,0 +1,8 @@
{{- $filename := print "warewulf-unmanaged.conf" }}
{{- file $filename }}
# This file is autogenerated by warewulf
[main]
plugins=keyfile
[keyfile]
unmanaged-devices={{ range $connection_id, $netdev := .NetDevs }}except:interface-name:{{- $netdev.Device -}},{{ end }}

View File

@@ -0,0 +1,82 @@
{{- range $connection_id, $netdev := .NetDevs }}
{{- $filename := print "warewulf-" $connection_id ".conf" }}
{{- file $filename }}
# This file is autogenerated by warewulf
[connection]
id={{ $connection_id }}
interface-name={{ $netdev.Device }}
{{ if $netdev.Type -}}
{{ if eq $netdev.Type "bond-slave" -}}
slave-type=bond
{{- $conn := split "_" $connection_id }}
{{- $master := $conn._0 }}
master={{ $master }}
type=ethernet
{{ else }}
type={{ $netdev.Type }}
autoconnect={{ $netdev.OnBoot }}
{{ end -}}
{{ end -}}
{{ if $netdev.Hwaddr -}}
{{ if eq $netdev.Type "ethernet" -}}
[ethernet]
mac-address={{ $netdev.Hwaddr }}
{{ if $netdev.MTU -}}
mtu={{ $netdev.MTU }}
{{ end -}}
{{ end -}}
{{ end -}}
# bond
{{ if eq $netdev.Type "bond" -}}
[ethernet]
{{ if $netdev.MTU -}}
mtu={{ $netdev.MTU }}
{{ end -}}
[bond]
downdelay=0
miimon=100
mode=802.3ad
xmit_hash_policy=layer2+3
updelay=0
{{ end -}}
{{ if eq $netdev.Type "infiniband" -}}
[infiniband]
transport-mode=datagram
{{ if $netdev.MTU -}}
mtu={{ $netdev.MTU }}
{{ end -}}
{{ end -}}
{{ if and ($netdev.IpCIDR) (ne $netdev.Type "bond-slave") -}}
[ipv4]
address={{ $netdev.IpCIDR }}
{{ if $netdev.Gateway -}}
gateway={{ $netdev.Gateway }}
{{ end -}}
method=manual
{{- $dns := "" }}
{{range $tk, $tv := $netdev.Tags -}}
{{ $prefix := substr 0 3 $tk -}}
{{ if eq $prefix "DNS" -}}
{{ $dns = print $dns $tv ";" -}}
{{ end -}}
{{ end -}}
{{ if ne $dns "" -}}
dns={{$dns}}
{{ end -}}
{{ end -}}
{{/* always autoconfigure ipv6 */}}
[ipv6]
addr-gen-mode=stable-privacy
method=ignore
never-default=true
{{ if $netdev.Ipaddr6 -}}
ipaddr="{{ $netdev.Ipaddr6 }}"
{{ end -}}
{{ end -}}