Tagged: Jinja2
2 posts · browse all tags
-
Jinja trim_blocks Swallows the Newline After a Trailing Comment and Joins Two Config Lines
A Jinja comment at the end of a config line, with trim_blocks on, removes the line break and glues the next line onto it. No error, no warning. A reproduction, three fixes, and a small render check that catches it.
-
Ansible Deep Dive Part 4: Variables, Facts, and Jinja2 Templating
Part 4: where variables come from, gathering and using facts, the Jinja2 syntax underneath when/template/filters, common filters worth knowing, and building real config templates for both servers and network devices.