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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user