Training
Bootcamp
Courses
Tech Sessions
Resources
Blog
Tips
GitHub
YouTube
Newsletter
Playgrounds
Pricing
Sign In
Become Member
Jinja2 Renderer
Validate and test the rendering of your Jinja templates
Tools
J2 Renderer
TTP Parser
TextFSM Parser
XPath Tester
Members Only
JMESPath Validator
JSON Schema Validator
Data Format Converter
Help Us Improve
Jinja Template
hostname {{ hostname | upper }} ip domain-name {{ domain_name }} ip domain-lookup {% for int_name in interfaces %} interface {{ int_name }} switchport mode {{ interfaces[int_name].mode | default ('trunk') }} switchport trunk allowed vlan add {{ vlans | join(", ") }} {{ interfaces[int_name].admin }} {% endfor %} no logging console
Jinja Data
{ "hostname": "rtr-001", "domain_name": "packetcoders.lab", "interfaces": { "gi1/1": {"admin": "no shut"}, "gi1/2": {"admin": "no shut"}, "gi1/3": {"admin": "no shut"}, }, "vlans": [100, 200, 300, 400, 500], }
Result
hostname RTR-001 ip domain-name packetcoders.lab ip domain-lookup interface gi1/1 switchport mode trunk switchport trunk allowed vlan add 100, 200, 300, 400, 500 no shut interface gi1/2 switchport mode trunk switchport trunk allowed vlan add 100, 200, 300, 400, 500 no shut interface gi1/3 switchport mode trunk switchport trunk allowed vlan add 100, 200, 300, 400, 500 no shut no logging console
Show whitespace
Trim blocks
Lstrip blocks
Render
Share
Auto-Sync