Files
warewulf/overlays/systemd.mount/rootfs/etc/systemd/system/local-fs.target.wants/disk.mount.ww
Jonathon Anderson 2bad789f4f Fix newline handling in file, softlink, and ImportLink template functions
Use state-based routing instead of sentinel strings, so whitespace-trimming
syntax (e.g. `{{- file "name" -}}`) correctly creates all named files and
symlinks.

Fixes: #2118

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
Co-authored-by: Christian Goll <cgoll@suse.com>
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
2026-04-17 22:51:10 -06:00

12 lines
348 B
Plaintext

{{- $abort := true }}
{{- range $fs := .ThisNode.FileSystemList }}
{{- if and $fs.Path (ne $fs.Format "swap") }}
{{- $abort = false }}
{{- file (print ($fs.Path | SystemdEscapePath) ".mount") -}}
{{ softlink (print "/etc/systemd/system/" ($fs.Path | SystemdEscapePath) ".mount") }}
{{- end }}
{{- end }}
{{- if $abort }}
{{ abort }}
{{- end }}