Expand description
Jinja2 rendering helpers for SAT (System Admin Toolkit) template files
and a structure-aware filter that operates on the parsed
serde_json::Value.
The canonical SAT-file schema lives in csm-rs (which parses the value into typed structs during apply). The CLI never carries the typed schema โ it only needs to:
- Render Jinja2 templates with a values file +
--varoverrides (the renderer takes parsed YAML as Jinja context for the values file but produces a string for the SAT file content). - Parse the rendered SAT string into a
serde_json::Valueso the server can forward it verbatim. - Apply
--image-only/--sessiontemplate-onlyfilters by walking the Value (drop top-level sections plus prune unreferenced configurations/images) before sending.
Both --image-only and --sessiontemplate-only preserve the
historical CLI semantics:
--image-only: dropssession_templates+hardware; retains only configurations referenced by the remaining images.--sessiontemplate-only: dropshardware; retains images only if named in a session_template; drops theimagessection entirely if no image survives; retains only configurations referenced by surviving images or session_templates.
The walk navigates a small set of field names
(configurations, images, session_templates, hardware,
name, configuration, image, image_ref, ims) โ no struct
schema is embedded here.
Functionsยง
- apply_
sat_ file_ filters - Apply
--image-only/--sessiontemplate-onlyfilters to a parsed SAT file in-place. - render_
jinja2_ sat_ file_ yaml - Render a SAT file as a Jinja2 template, optionally merging a values
file and CLI-provided overrides in dot notation. Returns the
rendered SAT YAML as a string โ callers parse it into the structured
value they need (CLI parses to
serde_json::Value).