Skip to content

Instantly share code, notes, and snippets.

@liamkeegan
Created May 10, 2023 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liamkeegan/314d9d478e1a7c53514a1a4ad496af2d to your computer and use it in GitHub Desktop.
Save liamkeegan/314d9d478e1a7c53514a1a4ad496af2d to your computer and use it in GitHub Desktop.
ACI - Jinja Template for EPG
Jinja2 Live Website: https://j2live.ttl255.com/
---
{
"tenant": "Production",
"ap": "Prod_AP",
"epgs": [
{
"name": "10.75.1.0-24",
"mode": "regular",
"vlan": 123
},
{
"name": "10.75.2.0-24",
"mode": "regular",
"vlan": 234
},
{
"name": "10.75.3.0-24",
"mode": "regular",
"vlan": 345
},
{
"name": "10.75.4.0-24",
"mode": "regular",
"vlan": 456
}
],
"ports": [
"topology/pod-1/protpaths-101-102/pathep-[Vpc1_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc2_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc3_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc4_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc5_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc6_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc7_IntPoPlGrp]",
"topology/pod-1/protpaths-101-102/pathep-[Vpc8_IntPoPlGrp]"
]
}
---
<fvTenant name="{{ tenant }}">
<fvAp descr="" name="{{ ap }}">
{% for epg in epgs -%}
<fvAEPg descr="" exceptionTag="" floodOnEncap="disabled" fwdCtrl="" hasMcastSource="no" isAttrBasedEPg="no" matchT="AtleastOne" name="{{ epg.name }}" nameAlias="" pcEnfPref="unenforced" prefGrMemb="exclude" prio="unspecified" shutdown="no">
{% for port in ports -%}
<fvRsPathAtt descr="" encap="vlan-{{ epg.vlan }}" instrImedcy="lazy" mode="{{ epg.mode }}" primaryEncap="unknown" tDn="{{ port }}"/>
{% endfor -%}
</fvAEPg>
{% endfor -%}
</fvAp>
</fvTenant>
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment