From 81ff852d896b67e2c0232246738ab992f3312a8b Mon Sep 17 00:00:00 2001 From: Dan Ankers Date: Fri, 28 Jun 2024 20:28:24 +0100 Subject: [PATCH] More fixes --- juniper-macros.j2 | 6 +++--- juniper-vxlan.j2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index e4242d6..0bd03b9 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -197,10 +197,10 @@ snmp { } {%- endmacro %} -{% macro routingoptionssection(primary_ip4, overlay_as, gateway) %} +{% macro routingoptionssection(device, gateway) %} routing-options { - router-id {{ primary_ip4.address.ip }}; - autonomous-system {{ overlay_as }}; + router-id {{ device.primary_ip4.address.ip }}; + autonomous-system {{ device.local_context['overlay_as'] }}; {% if gateway %} static { route 0.0.0.0/0 next-hop {{ gateway }}; diff --git a/juniper-vxlan.j2 b/juniper-vxlan.j2 index e2ada81..1059bee 100644 --- a/juniper-vxlan.j2 +++ b/juniper-vxlan.j2 @@ -28,7 +28,7 @@ policy-options { } } } -{{ junos.routingoptionssection(primary_ip4, overlay_as, gateway) }} +{{ junos.routingoptionssection(device, gateway) }} protocols { {{ junos.bgpsection(device,dcim.Device.objects.filter(tenant=device.tenant,role__name='Spine')) }} {% if device.role.name == 'Leaf' %}