diff --git a/juniper-macros.j2 b/juniper-macros.j2 index 0f2d7f6..638fe85 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -140,7 +140,11 @@ chassis { {% macro interfacesection(device,vlans) %} interfaces { -{% for interface in device['interfaces'] if interface['name'].startswith('xe-') or interface['name'].startswith('et-') %} +{# Physical interfaces should be sorted by FPC/PIC/Port value - that's a challenge to do in Jinja so we cheat for now by putting the xe- interfaces first. This won't work for all devices! #} +{% for interface in device['interfaces'] if interface['name'].startswith('xe-') %} +{{ interfaceconfig(interface) }} +{% endfor %} +{% for interface in device['interfaces'] if interface['name'].startswith('et-') %} {{ interfaceconfig(interface) }} {% endfor %} {% for interface in device['interfaces'] if interface['name'].startswith('ae') %}