|
@ -9,17 +9,18 @@ interfaces { |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
|
|
|
|
|
|
{%- if '@' in interface.name %} |
|
|
{%- if '@' in interface.name %} |
|
|
/* groups interface: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
/* do not configure groups interface: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
{%- elif interface.mgmt_only %} |
|
|
{%- elif interface.mgmt_only %} |
|
|
/* management interface: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
/* do not configure management-only interface: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
{%- elif 'no-automation' in interface_tags %} |
|
|
{%- elif 'no-automation' in interface_tags %} |
|
|
/* do not configure: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
/* do not configure no-automation interface: {{ interface.name }} */ |
|
|
|
|
|
|
|
|
{% elif interface.lag %} |
|
|
{% elif interface.lag %} |
|
|
{{ interface.name }} { |
|
|
{{ interface.name }} { |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
|
|
|
{{ macros.interface_common(interface, interface_context, mtu=False) }} |
|
|
gigether-options { |
|
|
gigether-options { |
|
|
802.3ad {{ interface.lag.name }}; |
|
|
802.3ad {{ interface.lag.name }}; |
|
|
} |
|
|
} |
|
@ -27,6 +28,8 @@ interfaces { |
|
|
{%- elif interface.name.startswith( 'lo' ) %} |
|
|
{%- elif interface.name.startswith( 'lo' ) %} |
|
|
{{ interface.name }} { |
|
|
{{ interface.name }} { |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
|
|
|
{{ macros.interface_common(interface, interface_context) }} |
|
|
|
|
|
|
|
|
{%- for unit, subinterface in subinterfaces %} |
|
|
{%- for unit, subinterface in subinterfaces %} |
|
|
unit {{ unit }} { |
|
|
unit {{ unit }} { |
|
|
{%- if subinterface.untagged_vlan %} |
|
|
{%- if subinterface.untagged_vlan %} |
|
@ -35,9 +38,9 @@ interfaces { |
|
|
vlan-id {{ unit }}; |
|
|
vlan-id {{ unit }}; |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
{%- set subinterface_context = subinterface.tags|get_netbox_tags_contexts|contexts_merge_last %} |
|
|
{%- set subinterface_context = subinterface.tags|get_netbox_tags_contexts|contexts_merge_last %} |
|
|
{# interface_vrf(subinterface, subinterface_context) #} |
|
|
|
|
|
{# interface_common(subinterface, subinterface_context) #} |
|
|
|
|
|
{{ macros.interface_addresses(subinterface, subinterface_context) }} |
|
|
|
|
|
|
|
|
{{ macros.interface_description(subinterface, subinterface_context) }} |
|
|
|
|
|
{{ macros.interface_common(subinterface, subinterface_context, mtu=False) }} |
|
|
|
|
|
{{ macros.interface_addresses(device, subinterface, subinterface_context, mtu=False) }} |
|
|
} |
|
|
} |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
|
|
|
|
|
@ -49,7 +52,7 @@ interfaces { |
|
|
link-speed 100g; |
|
|
link-speed 100g; |
|
|
} |
|
|
} |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
{# interface_common(interface, interface_context) #} |
|
|
|
|
|
|
|
|
{{ macros.interface_common(interface, interface_context, mtu=True) }} |
|
|
|
|
|
|
|
|
{%- elif interface.type.value != 'virtual' %} |
|
|
{%- elif interface.type.value != 'virtual' %} |
|
|
{{ interface.name }} { |
|
|
{{ interface.name }} { |
|
@ -57,9 +60,9 @@ interfaces { |
|
|
|
|
|
|
|
|
{%- if not interface.mode or ( interface.mode.value == 'access' ) %} |
|
|
{%- if not interface.mode or ( interface.mode.value == 'access' ) %} |
|
|
unit 0 { |
|
|
unit 0 { |
|
|
{# interface_vrf(interface, interface_context) #} |
|
|
|
|
|
{# interface_common(interface, interface_context) #} |
|
|
|
|
|
{{ macros.interface_addresses(interface, interface_context) }} |
|
|
|
|
|
|
|
|
{{ macros.interface_description(interface, interface_context) }} |
|
|
|
|
|
{{ macros.interface_common(interface, interface_context, mtu=False) }} |
|
|
|
|
|
{{ macros.interface_addresses(device, interface, interface_context, mtu=True) }} |
|
|
} |
|
|
} |
|
|
{%- elif interface.mode.value == 'tagged' %} |
|
|
{%- elif interface.mode.value == 'tagged' %} |
|
|
vlan-tagging; |
|
|
vlan-tagging; |
|
@ -79,9 +82,9 @@ interfaces { |
|
|
vlan-id {{ unit }}; |
|
|
vlan-id {{ unit }}; |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
{%- set subinterface_context = subinterface.tags|get_netbox_tags_contexts|contexts_merge_last %} |
|
|
{%- set subinterface_context = subinterface.tags|get_netbox_tags_contexts|contexts_merge_last %} |
|
|
{# interface_vrf(subinterface, subinterface_context) #} |
|
|
|
|
|
{# interface_common(subinterface, subinterface_context) #} |
|
|
|
|
|
{{ macros.interface_addresses(subinterface, subinterface_context) }} |
|
|
|
|
|
|
|
|
{{ macros.interface_description(subinterface, subinterface_context) }} |
|
|
|
|
|
{{ macros.interface_common(subinterface, subinterface_context, mtu=False) }} |
|
|
|
|
|
{{ macros.interface_addresses(device, subinterface, subinterface_context, mtu=True) }} |
|
|
} |
|
|
} |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|