Refactor ignition support during dracut

- Control root device using the node/profile root field
- Add support for `/warewulf/wwinit.d` to run scripts during first stage
- Move first-stage ignition support to `/warewulf/wwinit.d/`
- Add `wwctl <node|profile> set --parttype`
- Add overlay template functions `SystemdEscape` and `SystemdEscapePath`
- Support configuring ignition with resources

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-06-30 23:09:49 -06:00
parent 608ef89d40
commit b98eae4b01
29 changed files with 787 additions and 354 deletions

View File

@@ -148,7 +148,13 @@ symlink.
IgnitionJson
------------
Generates JSON suitable for use by Ignition to create
Generates JSON suitable for use by Ignition to create partitions and file
systems, from the data stored in a node's native ``disks`` and ``filesystems``
fields.
.. code-block::
{{ IgnitionJson }}
abort
-----
@@ -174,10 +180,9 @@ nobackup
UniqueField
-----------
UniqueField returns a filtered version of a multi-line input string. input is
expected to be a field-separated format with one record per line (terminated by
`\n`). Order of lines is preserved, with the first matching line taking
precedence.
Returns a filtered version of a multi-line input string. input is expected to be
a field-separated format with one record per line (terminated by `\n`). Order of
lines is preserved, with the first matching line taking precedence.
For example, the following template snippet has been used in the ``syncuser`` overlay
to generate a combined ``/etc/passwd``.
@@ -191,6 +196,24 @@ to generate a combined ``/etc/passwd``.
| UniqueField ":" 0 | trim
}}
SystemdEscape
-------------
Escapes a string for use in a systemd unit file.
Escape rules are documented at `systemd.unit. <https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#String%20Escaping%20for%20Inclusion%20in%20Unit%20Names>`_
SystemdEscapePath
-----------------
Escapes a path for use in a systemd unit file.
.. code-block::
{{ file (print ($fs.path | SystemdEscapePath) ".mount") }}
Escape rules are documented at `systemd.unit. <https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html#String%20Escaping%20for%20Inclusion%20in%20Unit%20Names>`_
Examples
========