create fstab from resource
Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
07c77a63d5
commit
77bdfba816
@@ -63,6 +63,6 @@ proc /proc proc defaults 0 0
|
||||
# all with noauto as mounts happens with systemd units
|
||||
/dev/disk/by-partlabel/scratch /scratch btrfs noauto,defaults 0 0
|
||||
/dev/disk/by-partlabel/swap swap swap noauto,defaults 0 0
|
||||
# nfs mounts provided in warewulf.conf
|
||||
# Resource: NFSHOME
|
||||
192.168.0.1:/home /home nfs defaults 0 0
|
||||
`
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
nodes:
|
||||
node1:
|
||||
resource_list:
|
||||
- NFSHOME
|
||||
disks:
|
||||
/dev/vda:
|
||||
wipe_table: true
|
||||
@@ -17,3 +19,10 @@ nodes:
|
||||
/dev/disk/by-partlabel/swap:
|
||||
format: swap
|
||||
path: swap
|
||||
resource:
|
||||
NFSHOME:
|
||||
mountpoint: /home
|
||||
moptions: defaults
|
||||
eoptions: rw,rootsquash
|
||||
epath: /home
|
||||
server: controller
|
||||
|
||||
@@ -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 }}
|
||||
Reference in New Issue
Block a user