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 }} ip domain-name {{ domain_name }} {# Looping lists #} {% for vlan in vlans %} vlan {{ vlan }} name VLAN-{{ vlan }} {% endfor %} {# Looping dicts #} {% for int_name, int_data in interfaces.items() %} interface {{ int_name }} ip address {{ int_data.ip_addr }} {{ int_data.admin }} {% endfor %}
Jinja Data
{ "hostname": "rtr-001", "domain_name": "packetcoders.lab", "vlans": [100, 200, 300], "interfaces": { "gi1/1": {"ip_addr": "10.1.1.1/24", "admin": "no shut"}, "gi1/2": {"ip_addr": "10.1.2.1/24", "admin": "no shut"}, "gi1/3": {"ip_addr": "10.1.2.1/24", "admin": "no shut"}, }, }
Result
hostname rtr-001 ip domain-name packetcoders.lab vlan 100 name VLAN-100 vlan 200 name VLAN-200 vlan 300 name VLAN-300 interface gi1/1 ip address 10.1.1.1/24 no shut interface gi1/2 ip address 10.1.2.1/24 no shut interface gi1/3 ip address 10.1.2.1/24 no shut
Show whitespace
Trim blocks
Lstrip blocks
Render
Share
Auto-Sync