From 8fc40e6c19e2041a64388e38010d85be4fa2c4c7 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Fri, 5 Jul 2024 13:49:44 +0100 Subject: [PATCH] Don't put interfaces with no settings into the configuration --- juniper-macros.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 847ce7c..f152efe 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -113,6 +113,7 @@ chassis { {% macro interfaceconfig(interface,rack = None) %} +{% if not (interface.name.contains('-')) or interface.name or interface.description or interface.lag or interface.ip_addresses.count() or interface.connected_endpoints or interface.mode or interface.tagged_vlans or interface.untagged_vlan %} {{ interface.name }} { {% if interface.description != '' %} description "{{ interface.description }}"; @@ -195,6 +196,7 @@ chassis { {% endif %} {% endif %} } +{% endif %} {%- endmacro %} {% macro interfacesection(device,vlans) %}