Stop trying to get the sort right - it looks like Juniper might put it in in the order it was added to the config

main
Daniel Ankers 2024-01-22 11:46:12 +00:00
parent 4b6297e832
commit e11b54d16c
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ interfaces {
{% for interface in device['interfaces'] if interface['name'].startswith('et-') %}
{{ interfaceconfig(interface) }}
{% endfor %}
{% for interface in device['interfaces']|sort(attribute='name') if interface['name'].startswith('ae') %}
{% for interface in device['interfaces'] if interface['name'].startswith('ae') %}
{{ interfaceconfig(interface,device['rack']['name'][5:]) }}
{% endfor %}
{% for interface in device['interfaces'] if interface['name']=='em0' %}
@ -303,7 +303,7 @@ routing-options {
{% macro vlanssection(vlans,device) %}
vlans {
{# This next line selects all of the VLANs which are configured on this device #}
{% for vlan in vlans|sort(attribute='name') if (device['interfaces']|selectattr('untagged_vlan.vid','equalto',vlan)|list|count or interfaces|map(attribute='tagged_vlans')|sum(start=[])|selectattr('vid','equalto',vlan)|list|count) or device['interfaces']|selectattr('name', 'equalto', 'irb.'+vlan['vid']|string)|list|count %}
{% for vlan in vlans if (device['interfaces']|selectattr('untagged_vlan.vid','equalto',vlan)|list|count or interfaces|map(attribute='tagged_vlans')|sum(start=[])|selectattr('vid','equalto',vlan)|list|count) or device['interfaces']|selectattr('name', 'equalto', 'irb.'+vlan['vid']|string)|list|count %}
vl{{ vlan['vid'] }} {
{% if vlan['name'] != '' %}
description "{{ vlan['name'] }}";