{{- range $fsdevice,$fs := .FileSystems }} {{- $prefix := replace "-" "\\x2d" $fs.Path }} {{- $prefix = replace "/" "-" $prefix }} {{- $prefix = substr 1 -1 $prefix }} {{ $suffix := "mount"}} {{- if $fs.Label }}{{ $prefix = $fs.Label }}{{ end }} {{- if eq $fs.Format "swap" }}{{ $prefix = replace "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-" $fsdevice }}{{ $suffix = "swap" }}{{ end }} {{ file (print $prefix "." $suffix) }} # This file is autogenerated by warewulf {{- if eq $fs.Format "swap"}} [Unit] ConditionPathExists=/warewulf/ignition.json Requires=ignition-ww4-disks.service After=ignition-ww4-disks.service Before=swap.target [Swap] What={{ $fsdevice }} [Install] RequiredBy=swap.target {{- else }} [Unit] ConditionPathExists=/warewulf/ignition.json Before=local-fs.target Requires=ignition-ww4-disks.service After=ignition-ww4-disks.service [Mount] Where={{ $fs.Path }} What={{ $fsdevice }} Type={{ $fs.Format }} {{- if $fs.MountOptions }} Options={{range $index,$opt := $fs.MountOptions }}{{if $index }},{{ end }}{{ $opt }}{{ end }} {{- end }} [Install] RequiredBy=local-fs.target {{- end }} {{- end }}