Rename systemd templates in the ignition overlay for clarity
Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- Added Ipv6 support to `/etc/hosts` on host and nodes.
|
- Added Ipv6 support to `/etc/hosts` on host and nodes.
|
||||||
- Added IPv6 support to wwclient
|
- Added IPv6 support to wwclient
|
||||||
- `sfdisk` overlay creates a GPT label when wiping disks. #2025
|
- `sfdisk` overlay creates a GPT label when wiping disks. #2025
|
||||||
|
- Renamed systemd templates in the `ignition` overlay for clarity.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ func Test_ignitionOverlay(t *testing.T) {
|
|||||||
output string
|
output string
|
||||||
isJson bool
|
isJson bool
|
||||||
}{
|
}{
|
||||||
"ignition:ww4-disks.target": {
|
"ignition:ww-ignition-disks.target": {
|
||||||
args: []string{"--quiet", "--render", "node1", "ignition", "etc/systemd/system/ww4-disks.target.ww"},
|
args: []string{"--quiet", "--render", "node1", "ignition", "etc/systemd/system/ww-ignition-disks.target.ww"},
|
||||||
nodesConf: `
|
nodesConf: `
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
@@ -44,17 +44,17 @@ nodes:
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=mount ww4 disks
|
Description=mount ww4 disks
|
||||||
# make sure that the disks are available
|
# make sure that the disks are available
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
Requisite=ignition-ww4-disks.service
|
Requisite=ww-ignition.service
|
||||||
# Get the mounts
|
# Get the mounts
|
||||||
Wants=scratch.mount
|
Wants=scratch.mount
|
||||||
Wants=dev-disk-by\x2dpartlabel-swap.swap
|
Wants=dev-disk-by\x2dpartlabel-swap.swap
|
||||||
`,
|
`,
|
||||||
isJson: false,
|
isJson: false,
|
||||||
},
|
},
|
||||||
"ignition:ww4-disks.target (resources)": {
|
"ignition:ww-ignition-disks.target (resources)": {
|
||||||
args: []string{"--quiet", "--render", "node1", "ignition", "etc/systemd/system/ww4-disks.target.ww"},
|
args: []string{"--quiet", "--render", "node1", "ignition", "etc/systemd/system/ww-ignition-disks.target.ww"},
|
||||||
nodesConf: `
|
nodesConf: `
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
@@ -83,17 +83,17 @@ nodes:
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=mount ww4 disks
|
Description=mount ww4 disks
|
||||||
# make sure that the disks are available
|
# make sure that the disks are available
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
Requisite=ignition-ww4-disks.service
|
Requisite=ww-ignition.service
|
||||||
# Get the mounts
|
# Get the mounts
|
||||||
Wants=scratch.mount
|
Wants=scratch.mount
|
||||||
Wants=dev-disk-by\x2dpartlabel-swap.swap
|
Wants=dev-disk-by\x2dpartlabel-swap.swap
|
||||||
`,
|
`,
|
||||||
isJson: false,
|
isJson: false,
|
||||||
},
|
},
|
||||||
"ignition:ww4-mounts": {
|
"ignition:ignition.mount": {
|
||||||
args: []string{"--quiet=false", "--render", "node1", "ignition", "etc/systemd/system/ww4-mounts.ww"},
|
args: []string{"--quiet=false", "--render", "node1", "ignition", "etc/systemd/system/ignition.mount.ww"},
|
||||||
nodesConf: `
|
nodesConf: `
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
@@ -124,8 +124,8 @@ Filename: scratch.mount
|
|||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
[Mount]
|
[Mount]
|
||||||
Where=/scratch
|
Where=/scratch
|
||||||
What=/dev/disk/by-partlabel/scratch
|
What=/dev/disk/by-partlabel/scratch
|
||||||
@@ -133,25 +133,11 @@ Type=btrfs
|
|||||||
Options=nondefault
|
Options=nondefault
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=local-fs.target
|
RequiredBy=local-fs.target
|
||||||
backupFile: true
|
|
||||||
writeFile: true
|
|
||||||
Filename: dev-disk-by\x2dpartlabel-swap.swap
|
|
||||||
# This file is autogenerated by warewulf
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
|
||||||
Requires=ignition-ww4-disks.service
|
|
||||||
After=ignition-ww4-disks.service
|
|
||||||
Before=swap.target
|
|
||||||
[Swap]
|
|
||||||
What=/dev/disk/by-partlabel/swap
|
|
||||||
[Install]
|
|
||||||
RequiredBy=swap.target
|
|
||||||
`,
|
`,
|
||||||
isJson: false,
|
isJson: false,
|
||||||
},
|
},
|
||||||
"ignition:ww4-mounts (resources)": {
|
"ignition:ignition.mount (resources)": {
|
||||||
args: []string{"--quiet=false", "--render", "node1", "ignition", "etc/systemd/system/ww4-mounts.ww"},
|
args: []string{"--quiet=false", "--render", "node1", "ignition", "etc/systemd/system/ignition.mount.ww"},
|
||||||
nodesConf: `
|
nodesConf: `
|
||||||
nodes:
|
nodes:
|
||||||
node1:
|
node1:
|
||||||
@@ -184,23 +170,52 @@ Filename: scratch.mount
|
|||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
[Mount]
|
[Mount]
|
||||||
Where=/scratch
|
Where=/scratch
|
||||||
What=/dev/disk/by-partlabel/scratch
|
What=/dev/disk/by-partlabel/scratch
|
||||||
Type=btrfs
|
Type=btrfs
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=local-fs.target
|
RequiredBy=local-fs.target
|
||||||
backupFile: true
|
`,
|
||||||
|
isJson: false,
|
||||||
|
},
|
||||||
|
"ignition:ignition.swap (resources)": {
|
||||||
|
args: []string{"--quiet=false", "--render", "node1", "ignition", "etc/systemd/system/ignition.swap.ww"},
|
||||||
|
nodesConf: `
|
||||||
|
nodes:
|
||||||
|
node1:
|
||||||
|
resources:
|
||||||
|
ignition:
|
||||||
|
storage:
|
||||||
|
disks:
|
||||||
|
- device: /dev/vda
|
||||||
|
wipeTable: true
|
||||||
|
partitions:
|
||||||
|
scratch:
|
||||||
|
shouldExist: true
|
||||||
|
swap:
|
||||||
|
number: 1
|
||||||
|
sizeMiB: 1024
|
||||||
|
filesystems:
|
||||||
|
- device: /dev/disk/by-partlabel/scratch
|
||||||
|
format: btrfs
|
||||||
|
path: /scratch
|
||||||
|
wipeFilesystem: true
|
||||||
|
- device: /dev/disk/by-partlabel/swap
|
||||||
|
format: swap
|
||||||
|
path: swap`,
|
||||||
|
output: `backupFile: true
|
||||||
writeFile: true
|
writeFile: true
|
||||||
Filename: dev-disk-by\x2dpartlabel-swap.swap
|
Filename: dev-disk-by\x2dpartlabel-swap.swap
|
||||||
|
|
||||||
# This file is autogenerated by warewulf
|
# This file is autogenerated by warewulf
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
Before=swap.target
|
Before=swap.target
|
||||||
[Swap]
|
[Swap]
|
||||||
What=/dev/disk/by-partlabel/swap
|
What=/dev/disk/by-partlabel/swap
|
||||||
@@ -325,8 +340,9 @@ nodes:
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
env := testenv.New(t)
|
env := testenv.New(t)
|
||||||
defer env.RemoveAll()
|
defer env.RemoveAll()
|
||||||
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/etc/systemd/system/ww4-disks.target.ww", "../rootfs/etc/systemd/system/ww4-disks.target.ww")
|
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/etc/systemd/system/ww-ignition-disks.target.ww", "../rootfs/etc/systemd/system/ww-ignition-disks.target.ww")
|
||||||
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/etc/systemd/system/ww4-mounts.ww", "../rootfs/etc/systemd/system/ww4-mounts.ww")
|
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/etc/systemd/system/ignition.mount.ww", "../rootfs/etc/systemd/system/ignition.mount.ww")
|
||||||
|
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/etc/systemd/system/ignition.swap.ww", "../rootfs/etc/systemd/system/ignition.swap.ww")
|
||||||
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/warewulf/ignition.json.ww", "../rootfs/warewulf/ignition.json.ww")
|
env.ImportFile("var/lib/warewulf/overlays/ignition/rootfs/warewulf/ignition.json.ww", "../rootfs/warewulf/ignition.json.ww")
|
||||||
env.WriteFile("etc/warewulf/nodes.conf", tt.nodesConf)
|
env.WriteFile("etc/warewulf/nodes.conf", tt.nodesConf)
|
||||||
cmd := show.GetCommand()
|
cmd := show.GetCommand()
|
||||||
|
|||||||
@@ -1,27 +1,15 @@
|
|||||||
{{- if .FileSystems }}
|
{{- if .FileSystems }}
|
||||||
{{- range $fsdevice, $fs := .FileSystems }}
|
{{- range $fsdevice, $fs := .FileSystems }}
|
||||||
{{- if eq $fs.Format "swap" }}
|
{{- if ne $fs.Format "swap" }}
|
||||||
{{ file (print ($fsdevice | SystemdEscapePath) ".swap") }}
|
{{- if ne $fs.Path "" }}
|
||||||
# This file is autogenerated by warewulf
|
|
||||||
|
|
||||||
[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 if ne $fs.Path "" }}
|
|
||||||
{{ file (print ($fs.Path | SystemdEscapePath) ".mount") }}
|
{{ file (print ($fs.Path | SystemdEscapePath) ".mount") }}
|
||||||
# This file is autogenerated by warewulf
|
# This file is autogenerated by warewulf
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
[Mount]
|
[Mount]
|
||||||
Where={{ $fs.Path }}
|
Where={{ $fs.Path }}
|
||||||
What={{ $fsdevice }}
|
What={{ $fsdevice }}
|
||||||
@@ -31,34 +19,21 @@ Options={{ $fs.MountOptions }}
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=local-fs.target
|
RequiredBy=local-fs.target
|
||||||
{{- else }}
|
{{- end }}
|
||||||
{{- continue }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else if .Resources.ignition.storage.filesystems }}
|
{{- else if .Resources.ignition.storage.filesystems }}
|
||||||
{{- range $fs := .Resources.ignition.storage.filesystems }}
|
{{- range $fs := .Resources.ignition.storage.filesystems }}
|
||||||
{{- if eq $fs.format "swap" }}
|
{{- if ne $fs.format "swap" }}
|
||||||
{{ file (print ($fs.device | SystemdEscapePath) ".swap") }}
|
{{- if ne $fs.path "" }}
|
||||||
# This file is autogenerated by warewulf
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
|
||||||
Requires=ignition-ww4-disks.service
|
|
||||||
After=ignition-ww4-disks.service
|
|
||||||
Before=swap.target
|
|
||||||
[Swap]
|
|
||||||
What={{ $fs.device }}
|
|
||||||
[Install]
|
|
||||||
RequiredBy=swap.target
|
|
||||||
{{- else if ne $fs.path "" }}
|
|
||||||
{{ file (print ($fs.path | SystemdEscapePath) ".mount") }}
|
{{ file (print ($fs.path | SystemdEscapePath) ".mount") }}
|
||||||
# This file is autogenerated by warewulf
|
# This file is autogenerated by warewulf
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
ConditionPathExists=/warewulf/ignition.json
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
[Mount]
|
[Mount]
|
||||||
Where={{ $fs.path }}
|
Where={{ $fs.path }}
|
||||||
What={{ $fs.device }}
|
What={{ $fs.device }}
|
||||||
@@ -68,8 +43,7 @@ Options={{ $fs.mountOptions | join "." }}
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
[Install]
|
[Install]
|
||||||
RequiredBy=local-fs.target
|
RequiredBy=local-fs.target
|
||||||
{{- else }}
|
{{- end }}
|
||||||
{{- continue }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
35
overlays/ignition/rootfs/etc/systemd/system/ignition.swap.ww
Normal file
35
overlays/ignition/rootfs/etc/systemd/system/ignition.swap.ww
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{{- if .FileSystems }}
|
||||||
|
{{- range $fsdevice, $fs := .FileSystems }}
|
||||||
|
{{- if eq $fs.Format "swap" }}
|
||||||
|
{{ file (print ($fsdevice | SystemdEscapePath) ".swap") }}
|
||||||
|
# This file is autogenerated by warewulf
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
|
Requires=ww-ignition.service
|
||||||
|
After=ww-ignition.service
|
||||||
|
Before=swap.target
|
||||||
|
[Swap]
|
||||||
|
What={{ $fsdevice }}
|
||||||
|
[Install]
|
||||||
|
RequiredBy=swap.target
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if .Resources.ignition.storage.filesystems }}
|
||||||
|
{{- range $fs := .Resources.ignition.storage.filesystems }}
|
||||||
|
{{- if eq $fs.format "swap" }}
|
||||||
|
{{ file (print ($fs.device | SystemdEscapePath) ".swap") }}
|
||||||
|
# This file is autogenerated by warewulf
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
ConditionPathExists=/warewulf/ignition.json
|
||||||
|
Requires=ww-ignition.service
|
||||||
|
After=ww-ignition.service
|
||||||
|
Before=swap.target
|
||||||
|
[Swap]
|
||||||
|
What={{ $fs.device }}
|
||||||
|
[Install]
|
||||||
|
RequiredBy=swap.target
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -1 +0,0 @@
|
|||||||
/etc/systemd/system/ignition-ww4-disks.service
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../ww-ignition-disks.target
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../ww-ignition.service
|
||||||
@@ -1 +0,0 @@
|
|||||||
/etc/systemd/system/ww4-disks.target
|
|
||||||
@@ -3,9 +3,9 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=mount ww4 disks
|
Description=mount ww4 disks
|
||||||
# make sure that the disks are available
|
# make sure that the disks are available
|
||||||
Requires=ignition-ww4-disks.service
|
Requires=ww-ignition.service
|
||||||
After=ignition-ww4-disks.service
|
After=ww-ignition.service
|
||||||
Requisite=ignition-ww4-disks.service
|
Requisite=ww-ignition.service
|
||||||
# Get the mounts
|
# Get the mounts
|
||||||
{{- if .FileSystems }}
|
{{- if .FileSystems }}
|
||||||
{{- range $fsdevice, $fs := .FileSystems }}
|
{{- range $fsdevice, $fs := .FileSystems }}
|
||||||
Reference in New Issue
Block a user