create fstab from resource

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2024-11-26 11:10:32 +01:00
committed by Jonathon Anderson
parent 07c77a63d5
commit 77bdfba816
3 changed files with 17 additions and 9 deletions

View File

@@ -12,12 +12,11 @@ proc /proc proc defaults 0 0
{{- if $fs.MountOptions }} noauto{{range $index,$opt := $fs.MountOptions }},{{ $opt }}{{ end }} 0 0
{{- else }} noauto,defaults 0 0
{{- end }}{{ end }}{{ end }}
{{- $IP:=.Ipaddr }}
{{- if .Nfs.Enabled }}
# nfs mounts provided in warewulf.conf
{{- range .Nfs.ExportsExtended }}
{{- if .Mount }}
{{ $IP }}:{{ .Path }} {{ .Path }} nfs {{ .MountOptions }} 0 0
{{- end }}
{{- end }}
{{- $Resource := .Resource }}{{ $server := .Ipaddr}}{{/* export the needed values */}}
{{- range $i,$ResName := .ResourceList }}
{{- if eq (substr 0 3 $ResName) "NFS" }}{{ $nfs := (index $Resource $ResName)}}
# Resource: {{ $ResName }}
{{- if not (eq $nfs.server "controller") }}{{ $server = $nfs.server }}{{ end }}
{{ $server }}:{{ $nfs.epath}} {{ $nfs.mountpoint }} nfs {{ $nfs.moptions }} 0 0
{{- end }}
{{- end }}