From ffb65ba1fb62a089b3eda20ab4898f42657d1057 Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Wed, 21 May 2025 11:07:01 +0100
Subject: [PATCH] Update `edge_port` role for the use with commercial parties

- PHY MTU - depends on the edge_port type (CUSTOMER, PUBLIC, etc)
- Add another hold-time map (it should be configured for PUBLIC
edge-ports)
- If `lacp_xmit_interval_slow` coming from GSO subscription is True,
then explicitely configure it (the default value for this in SROS is
`fast`).
---
 .../templates/nokia/edge_port_create.j2          | 16 ++++++++++++++--
 geant/gap_ansible/roles/edge_port/vars/main.yml  | 10 ++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/geant/gap_ansible/roles/edge_port/templates/nokia/edge_port_create.j2 b/geant/gap_ansible/roles/edge_port/templates/nokia/edge_port_create.j2
index 2bce5e39..6249f050 100644
--- a/geant/gap_ansible/roles/edge_port/templates/nokia/edge_port_create.j2
+++ b/geant/gap_ansible/roles/edge_port/templates/nokia/edge_port_create.j2
@@ -11,13 +11,19 @@
           <ethernet>
               <mode>access</mode>
               <encap-type>{{ ep.encapsulation }}</encap-type>
-              <mtu>{{ mtu_phy | default(9192) }}</mtu>
+              <mtu>{{ mtu_phy[ep.edge_port_type] | default(9192) }}</mtu>
             {% if edge_ports_hold_time[ep.ga_id] is defined and edge_ports_hold_time[ep.ga_id] | length > 0 %}
               <hold-time>
                   <units>{{ edge_ports_hold_time[ep.ga_id].units }}</units>
                   <up>{{ edge_ports_hold_time[ep.ga_id].up }}</up>
                   <down>{{ edge_ports_hold_time[ep.ga_id].down }}</down>
               </hold-time>
+            {% elif phy_hold_time[ep.edge_port_type] is defined %}
+              <hold-time>
+                <units>{{ phy_hold_time[ep.edge_port_type][units] }}</units>
+                <up>{{ phy_hold_time[ep.edge_port_type][up] }}</up>
+                <down>{{ phy_hold_time[ep.edge_port_type][down] }}</down>
+              </hold-time>
             {% endif %}
             {% if edge_port_lldp_enable_map[ep.edge_port_type] is true %}
               <lldp>
@@ -49,8 +55,14 @@
           <admin-state>enable</admin-state>
           <encap-type>{{ ep.encapsulation }}</encap-type>
           <description>LAG {{ ep.edge_port_type }} {{ partner_name }}{{ ' | '+gaid_prefix+ep.ga_id if ep.ga_id is string }}{{ ' | '+csn_prefix+(ep.custom_service_name | replace("#","")) if ep.custom_service_name is string }}{{ ' | '+ep.edge_port_description if ep.edge_port_description is string }}</description>
+          {% if ep.mac_address is not none %}
+          <mac-address>{{ ep.mac_address }}</mac-address>
+          {% endif %}
           <mode>access</mode>
-         {% if ep.enable_lacp is true %} 
+          {% if ep.lacp_xmit_interval_slow %}
+          <lacp-xmit-interval>slow</lacp-xmit-interval>
+          {% endif %}
+          {% if ep.enable_lacp is true %}
           <lacp>
               <mode>active</mode>
               <administrative-key>{{ (ep.edge_port_name|split("-"))[1] }}</administrative-key>
diff --git a/geant/gap_ansible/roles/edge_port/vars/main.yml b/geant/gap_ansible/roles/edge_port/vars/main.yml
index 362f8c58..b8e9821a 100644
--- a/geant/gap_ansible/roles/edge_port/vars/main.yml
+++ b/geant/gap_ansible/roles/edge_port/vars/main.yml
@@ -17,3 +17,13 @@ edge_port_lldp_enable_map:
   PUBLIC: false
   RE_INTERCONNECT: false
   PRIVATE: false
+
+mtu_phy:
+  PUBLIC: 1518
+  CUSTOMER: 9192
+
+phy_hold_time:
+  PUBLIC:
+    units: seconds
+    up: 1
+    down: 1
-- 
GitLab