Skip to content
Snippets Groups Projects
Commit 8ff24f15 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

iptrunk_migration Nokia and Juniper templates update

- Interface descriptions
- BFD
- Min links
parent c7520a6c
Branches
Tags
1 merge request!147iptrunk_migration Nokia and Juniper templates update
Pipeline #87358 passed
{##}
{# I need to sort the source and the destination alfabetically #}
{% set trunk_direction_name = [ wfo_trunk.iptrunk.iptrunk_sides[0].iptrunk_side_node.router_fqdn.split(".")[1], wfo_trunk.iptrunk.iptrunk_sides[1].iptrunk_side_node.router_fqdn.split(".")[1] ] %}
{% set trunk_direction_name_sorted = trunk_direction_name|sort %}
{% set trunk_direction_name = [ new_node.router.router_fqdn.split(".")[1] | upper, remaining_side.name.split(".")[1] | upper ] %}
{% set trunk_direction_name_sorted = trunk_direction_name|sort %}
{##}
{% if new_side is defined %}
interfaces {
......@@ -9,8 +9,18 @@
description "LAG INFRASTRUCTURE BACKBONE ${{ new_side.port_sid }} | {{ trunk_direction_name_sorted[0] }}-{{ trunk_direction_name_sorted[1] }}";
mtu 9192;
aggregated-ether-options {
minimum-links {{new_side.minimum_links}};
{#link-speed {{common.link_speed}};#}
{% if new_side.trunk_type != "Dark_fiber" %}
bfd-liveness-detection {
minimum-interval {{ bfd_min_interval }};
neighbor {{ remaining_side['loopback'] }};
local-address {{ new_side['loopback'] }};
}
{% endif %}
{% if (new_side.minimum_links | int) > 0 %}
minimum-links {{ new_side.minimum_links }};
{% endif %}
minimum-links {{ new_side.minimum_links }};
{#link-speed {{new_side.link_speed}};#}
lacp {
active;
periodic fast;
......
......@@ -2,11 +2,14 @@
<configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
{##}
{% set trunk_direction_name = [ new_node.router.router_fqdn.split(".")[1] | upper, remaining_side.name.split(".")[1] | upper ] %}
{% set trunk_direction_name_sorted = trunk_direction_name|sort %}
{% for member in new_side.members %}
<port xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">
<port-id>{{ member.interface_name }}</port-id>
<admin-state>enable</admin-state>
<description>PHY INFRASTRUCTURE BACKBONE P_{{ new_side.ae_name }} | {{ new_side.description }} | {{ member.interface_description }}</description>
<description>PHY INFRASTRUCTURE BACKBONE P_{{ new_side.ae_name }} | {{ trunk_direction_name_sorted[0] }}-{{ trunk_direction_name_sorted[1] }} | {{ member.interface_description }}</description>
<ethernet>
<mode>network</mode>
<mtu>9212</mtu>
......@@ -28,7 +31,7 @@
<lag xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="replace">
<lag-name>{{ new_side.ae_name | lower }}</lag-name>
<admin-state>enable</admin-state>
<description>LAG INFRASTRUCTURE BACKBONE ${{ new_side.port_sid }} | {{ new_side.description }}</description>
<description>LAG INFRASTRUCTURE BACKBONE ${{ new_side.port_sid }} | {{ trunk_direction_name_sorted[0] }}-{{ trunk_direction_name_sorted[1] }}</description>
<mode>network</mode>
<lacp>
<mode>active</mode>
......@@ -39,13 +42,31 @@
<port-id>{{ member.interface_name }}</port-id>
</port>
{% endfor %}
{% if (new_side.minimum_links | int) > 1 %}
<port-threshold>
<value>{{ (new_side.minimum_links | int) - 1 }}</value>
<action>down</action>
</port-threshold>
{% endif %}
{% if new_side.trunk_type != "Dark_fiber" %}
<bfd-liveness>
<ipv4>
<admin-state>enable</admin-state>
<multiplier>3</multiplier>
<receive-interval>{{ bfd_min_interval }}</receive-interval>
<transmit-interval>{{ bfd_min_interval }}</transmit-interval>
<local-ip-address>{{ new_side['loopback'] }}</local-ip-address>
<remote-ip-address>{{ remaining_side['loopback'] }}</remote-ip-address>
</ipv4>
</bfd-liveness>
{% endif %}
</lag>
<router xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes">
<router-name>Base</router-name>
<interface alu:operation="replace">
<interface-name>{{ new_side.ae_name | lower }}.0</interface-name>
<admin-state>enable</admin-state>
<description>SRV_GLOBAL INFRASTRUCTURE BACKBONE #{{ new_side.description }}-IPTRUNK ${{ new_side.id }}| </description>
<description>SRV_GLOBAL INFRASTRUCTURE BACKBONE #{{ trunk_direction_name_sorted[0] }}-{{ trunk_direction_name_sorted[1] }}-IPTRUNK ${{ new_side.id }} | {{ trunk_direction_name_sorted[0] }}-{{ trunk_direction_name_sorted[1] }} | {{ new_side.description }}</description>
<ip-mtu>9000</ip-mtu>
<port>{{ new_side.ae_name | lower }}</port>
<ipv4>
......
......@@ -29,7 +29,7 @@ new_side:
id: "{{ wfo_trunk.iptrunk.geant_s_sid }}"
description: "{{ wfo_trunk.iptrunk.iptrunk_description }}"
speed: "{{ wfo_trunk.iptrunk.iptrunk_speed }}"
is_leased_line: false ## FIX: it to use iptrunk_type
trunk_type: "{{ wfo_trunk.iptrunk.iptrunk_type }}"
isis_metric: "{{ wfo_trunk.iptrunk.iptrunk_isis_metric }}"
minimum_links: "{{ wfo_trunk.iptrunk.iptrunk_minimum_links }}"
name: "{{ wfo_trunk.iptrunk.iptrunk_sides[replace_index | int].iptrunk_side_node.router_fqdn }}"
......@@ -39,3 +39,7 @@ new_side:
members: "{{ new_lag_member_interfaces }}"
# members_descriptions: "{{ wfo_trunk.iptrunk.iptrunk_sides[replace_index | int].iptrunk_side_ae_members_description }}"
port_sid: "{{ wfo_trunk.iptrunk.iptrunk_sides[replace_index | int].iptrunk_side_ae_geant_a_sid }}"
remaining_side:
name: "{{ wfo_trunk.iptrunk.iptrunk_sides[1-(replace_index | int) ].iptrunk_side_node.router_fqdn }}"
loopback: "{{ wfo_trunk.iptrunk.iptrunk_sides[1-(replace_index | int) ].iptrunk_side_node.router_lo_ipv4_address }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment