Automation · Configuration Management
Templates
Cheat sheet · https://pcornel.dk/topic.php?topic=5384
Answer
Templates in configuration management render config files from Jinja2, ERB or EPP templates with node variables, so one template produces the right file for every server.
Remember
- Templates render config files per node.
- Fail on undefined variables.
- Validate rendered files before restarting services.
First checks
ansible-playbook site.yml --check --diff --tags config— template diff- validate: parameter for templates — syntax check
- Templates in roles/templates/ — structure
Verify in this order
vars + template → file → validate → handler
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=5384