Pcornel
Automation · Templates

Rendering

Cheat sheet · https://pcornel.dk/topic.php?topic=5814

Back to the Topic

Answer

Rendering combines a template with variables to produce the final text, such as Ansible's template module or jinja2's render(), which should fail on undefined variables.

Remember

  • Rendering combines template and variables.
  • Fail on undefined variables.
  • Diff output with current config.

First checks

  • python3 render.py --data site.yml --template t.j2 > out.conf — render
  • Deterministic output (sorted) — stable diffs
  • Rendered files stored as artifacts — traceability

Verify in this order

data + template → rendered artifact

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5814

Confirmation

Confirm action

Continue?