From aa06b98385906a298ab2e24b56ac8b5fc8c3c30c Mon Sep 17 00:00:00 2001
From: Simone Spinelli <simone.spinelli@geant.org>
Date: Fri, 16 Feb 2024 13:42:39 +0100
Subject: [PATCH] Update JUNOS and NOKIA trunk_interface template to manage
interface removals
---
.../roles/iptrunk/templates/juniper/trunk_interface.j2 | 7 +++++++
.../roles/iptrunk/templates/nokia/trunk_interface.j2 | 9 +++++++++
2 files changed, 16 insertions(+)
diff --git a/geant/gap_ansible/roles/iptrunk/templates/juniper/trunk_interface.j2 b/geant/gap_ansible/roles/iptrunk/templates/juniper/trunk_interface.j2
index 30ad8d83..58393d4b 100644
--- a/geant/gap_ansible/roles/iptrunk/templates/juniper/trunk_interface.j2
+++ b/geant/gap_ansible/roles/iptrunk/templates/juniper/trunk_interface.j2
@@ -79,6 +79,13 @@
}
{% endfor %}
}
+ {% if removed_ae_members is defined %}
+ {% for member in removed_ae_members %}
+ replace: {{ member.interface_name }} {
+ description "PHY SPARE";
+ }
+ {% endfor %}
+ {% endif %}
protocols {
lldp {
{% for member in local.members %}
diff --git a/geant/gap_ansible/roles/iptrunk/templates/nokia/trunk_interface.j2 b/geant/gap_ansible/roles/iptrunk/templates/nokia/trunk_interface.j2
index 20ee86dc..5548f8db 100644
--- a/geant/gap_ansible/roles/iptrunk/templates/nokia/trunk_interface.j2
+++ b/geant/gap_ansible/roles/iptrunk/templates/nokia/trunk_interface.j2
@@ -43,6 +43,15 @@
</ethernet>
</port>
{% endfor %}
+{% if removed_ae_members is defined %}
+ <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>disable</admin-state>
+ <description>PHY SPARE</description>
+ </port>
+{% for member in removed_ae_members %}
+{% endfor %}
+{% endif %}
<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>{{ local.ae_name | lower }}</lag-name>
<admin-state>enable</admin-state>
--
GitLab