From 5114a4fcad9a815d8e87926dd7d2d60d1c67f18f Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Fri, 28 Jun 2024 13:13:22 +0100 Subject: [PATCH] Fix some selections which no longer come from GraphQL --- juniper-vxlan.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/juniper-vxlan.j2 b/juniper-vxlan.j2 index a45fc11..4c44e6a 100644 --- a/juniper-vxlan.j2 +++ b/juniper-vxlan.j2 @@ -3,7 +3,7 @@ {% if device.role['name'] == 'Leaf' %} {{ junos.chassissection(device,breakout_ports) }} {% endif %} -{{ junos.interfacesection(device,tenant['vlans']) }} +{{ junos.interfacesection(device,ipam.VLAN.objects.filter(tenant=device.tenant)) }} {{ junos.snmpsection(rack, snmp) }} {% if device_role['name'] == 'Leaf' %} forwarding-options { @@ -30,8 +30,8 @@ policy-options { } {{ junos.routingoptionssection(primary_ip4, overlay_as, gateway) }} protocols { -{{ junos.bgpsection(device,tenant['spines']) }} -{% if device_role['name'] == 'Leaf' %} +{{ junos.bgpsection(device,dcim.Device.objects.filter(tenant=device.tenant,role__name='Spine')) }} +{% if role['name'] == 'Leaf' %} evpn { encapsulation vxlan; extended-vni-list all; @@ -44,7 +44,7 @@ protocols { {{ junos.sflowsection(sflow) }} {% endif %} } -{% if device_role['name'] == 'Leaf' %} +{% if role['name'] == 'Leaf' %} switch-options { vtep-source-interface lo0.0; route-distinguisher {{ primary_ip4['address'][:-3] }}:1; @@ -53,5 +53,5 @@ switch-options { auto; } } -{{ junos.vlanssection(tenant['vlans'], device) }} +{{ junos.vlanssection(ipam.VLAN.objects.filter(tenant=device.tenant), device) }} {% endif %}