- Closes: #1482 - Closes: #1280 This also corrects poor handling of whitespace around the "file" function throughout the templates, given experiences with the network templates while implementing the bond behavior. Since the file function actually does produce output (that is parsed by Warewulf itself) it should not collaps prefix whitespace. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
{{- 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
|
|
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
|
|
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 }}
|