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>
25 lines
476 B
Plaintext
25 lines
476 B
Plaintext
{{- $abort := true }}
|
|
{{- range $fs := .ThisNode.FileSystemList }}
|
|
{{- if and $fs.Path (ne $fs.Format "swap") }}
|
|
{{- $abort = false }}
|
|
{{- file (print ($fs.Path | SystemdEscapePath) ".mount") -}}
|
|
|
|
[Unit]
|
|
Before=local-fs.target
|
|
|
|
[Mount]
|
|
Where={{ $fs.Path }}
|
|
What={{ $fs.Id }}
|
|
Type={{ $fs.Format }}
|
|
{{- if $fs.MountOptions }}
|
|
Options={{ $fs.MountOptions }}
|
|
{{- end }}
|
|
|
|
[Install]
|
|
RequiredBy=local-fs.target
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if $abort }}
|
|
{{ abort }}
|
|
{{- end }}
|