Recommended changes from review of #1568

- Make Resources an `interface{}` to support arbitrary yaml
- Remove `wwctl resource` as incompatible with arbitrary yaml
- Revert changes to host overlay templates
- Remove NFS mount options from warewulf.conf
- Replace NFS support / resource prefix with "fstab" resource
- Move resources to profiles
- Migrate warewulf.conf mounts to nodes.conf with `wwctl upgrade`
- Add documentation

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-01-17 01:28:14 -07:00
parent eff1edd038
commit bc52f3b7d7
61 changed files with 344 additions and 843 deletions

View File

@@ -58,7 +58,7 @@ func Test_hostOverlay(t *testing.T) {
conf: "",
args: []string{"--render", "host", "host", "etc/exports.ww"},
log: host_exports,
header: "# Do not edit after this line",
header: "",
},
{
name: "host:/etc/hosts",
@@ -278,10 +278,11 @@ dhcp-host=e6:92:39:49:7b:04,set:warewulf,node2,192.168.3.23,infinite
const host_exports string = `backupFile: true
writeFile: true
Filename: etc/exports
# Do not edit after this line
# This block is autogenerated by warewulf
# Resource: NFSHOME
# This file is autogenerated by warewulf
/home 192.168.0.0/255.255.255.0(rw,sync)
/opt 192.168.0.0/255.255.255.0(ro,sync,no_root_squash)
`
const host_hosts string = `backupFile: true

View File

@@ -15,10 +15,3 @@ nodes:
device: wwnet0
hwaddr: e6:92:39:49:7b:04
ipaddr: 192.168.3.23
resources:
NFSHOME:
mountpoint: /home
moptions: defaults
eoptions: rw,sync
epath: /home
server: controller

View File

@@ -19,9 +19,5 @@ nfs:
export paths:
- path: /home
export options: rw,sync
mount options: defaults
mount: true
- path: /opt
export options: ro,sync,no_root_squash
mount options: defaults
mount: false

View File

@@ -18,9 +18,5 @@ nfs:
export paths:
- path: /home
export options: rw,sync
mount options: defaults
mount: true
- path: /opt
export options: ro,sync,no_root_squash
mount options: defaults
mount: false

View File

@@ -1,10 +1,11 @@
{{ IncludeBlock "/etc/exports" "# Do not edit after this line" }}
# This block is autogenerated by warewulf
{{- if .Nfs.Enabled }}
# This file is autogenerated by warewulf
{{- $network := .Network }}
{{- $netmask := .Netmask }}
{{- range $ResName,$Res := .Resources }}
{{- if eq (substr 0 3 $ResName) "NFS" }}{{ if eq $Res.server "controller" }}
# Resource: {{ $ResName }}
{{ $Res.epath}} {{ $network }}/{{ $netmask }}({{ $Res.eoptions }})
{{- end }}{{ end }}
{{- range .Nfs.ExportsExtended }}
{{ .Path }} {{ $network }}/{{ $netmask }}({{ .ExportOptions }})
{{- end }}
{{- else }}
{{ abort }}
{{- end }}