Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #131 from mjbear/jinja_spacing
Browse files Browse the repository at this point in the history
jinja-yaml - add whitespace around variable in curly braces
  • Loading branch information
mthiel117 authored Mar 13, 2024
2 parents e6f323c + 47103af commit f0bd2d5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions workshops/jinja-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ aaa authentication login default {{ global['aaa_authentication']['login']['defau
aaa authorization exec default {{ global['aaa_authorization']['exec']['default'] }}
# Render clock timezone config line
clock timezone {{ global['clock']['timezone']}}
clock timezone {{ global['clock']['timezone'] }}
```

As you can see, the variable has many parameters in them. Let's walk through these parameters using the `aaa authentication` config line.
Expand Down Expand Up @@ -922,7 +922,7 @@ vxlan udp-port 4789
{% for vrf,vrf_values in vrf.items() %}
vxlan vrf {{vrf}} vni {{ vrf_values['l3vni']}}
vxlan vrf {{ vrf }} vni {{ vrf_values['l3vni'] }}
{% for vlan,vlan_values in vrf_values['vlans'].items() %}
Expand Down Expand Up @@ -954,7 +954,7 @@ First we will look at the `vrf` variables, and we will do this by changing the t
vxlan source-interface loopback1
vxlan udp-port 4789 #}
{% for vrf,vrf_values in vrf.items() %}
{# vxlan vrf {{vrf}} vni {{ vrf_values['l3vni']}} #}
{# vxlan vrf {{ vrf }} vni {{ vrf_values['l3vni'] }} #}
{{ vrf }}
{% for vlan,vlan_values in vrf_values['vlans'].items() %}
Expand Down Expand Up @@ -994,7 +994,7 @@ Now let's take a look at the `_params` variable. Changing the template to what f
vxlan source-interface loopback1
vxlan udp-port 4789 #}
{% for vrf,vrf_values in vrf.items() %}
{# vxlan vrf {{vrf}} vni {{ vrf_values['l3vni']}} #}
{# vxlan vrf {{ vrf }} vni {{ vrf_values['l3vni'] }} #}
{# {{ vrf }} #}
{{ vrf_values }}
Expand Down Expand Up @@ -1034,7 +1034,7 @@ vxlan udp-port 4789
{% for vrf,vrf_values in vrf.items() %}
vxlan vrf {{vrf}} vni {{ vrf_values['l3vni']}}
vxlan vrf {{ vrf }} vni {{ vrf_values['l3vni'] }}
{% for vlan,vlan_values in vrf_values['vlans'].items() %}
Expand Down Expand Up @@ -1209,9 +1209,9 @@ The Jinja template would look as follows:
ip radius vrf {{ radsrc['vrf'] }} source-interface {{ radsrc['name'] }}
{% endfor %}
mac address-table aging-time {{ global['mac_address_table']['aging_time']}}
mac address-table aging-time {{ global['mac_address_table']['aging_time'] }}
arp aging timeout {{ global['arp']['aging']['timeout_default']}}
arp aging timeout {{ global['arp']['aging']['timeout_default'] }}
{% for dns in global['name_servers'] %}
ip name-server {{ dns }}
Expand All @@ -1224,7 +1224,7 @@ The Jinja template would look as follows:
ntp server vrf {{ ntps['vrf'] }} {{ ntps['name'] }}
{% endfor %}
clock timezone {{ global['clock']['timezone']}}
clock timezone {{ global['clock']['timezone'] }}
vlan 4094
name MLAG
Expand Down

0 comments on commit f0bd2d5

Please sign in to comment.