BGP Router Manager templates for Voneus core and aggregation infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

groups {
{%- set re_groups = [] %}
{%- for interface, subinterfaces in device|get_interfaces|subinterfaces(".") %}
{%- if '@' in interface.name %}
{%- set re = interface.name.split("@")[1] %}
{%- do re_groups.append( re ) %}
{%- set interface_name = interface.name.split("@")[0] %}
{%- set interface_context = interface.tags|get_netbox_tags_contexts|contexts_merge_last %}
{{ re }} {
system {
host-name {{ re }}.{{ device.name }};
services {
ssh;
}
}
interfaces {
{{ interface_name}} {
unit 0 {
family inet {
{%- for address in interface|get_addresses %}{% if address|ipv4 %}
address {{ address.address }};
{%- endif %}{%- endfor %}
}
}
}
}
}
{%- endif %}
{%- endfor %}
}
apply-groups [ {% for re in re_groups %}{{ re }}{% if not loop.last %} {% endif %}{% endfor %} ];