From bd9b4ff6699d074d9cab06ced5ce7b21be89b89c Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342-AKURBATOV.local>
Date: Wed, 14 Aug 2024 20:10:56 +0100
Subject: [PATCH] updates and fixes to various templates

---
 .../templates/routers/nokia/ip_prefix_list.j2 |  1 +
 .../templates/routers/nokia/pe_base_config.j2 |  9 -----
 .../templates/routers/nokia/pe_base_vprn.j2   |  5 +++
 .../templates/routers/nokia/pe_update_sdp.j2  |  5 +++
 .../templates/routers/nokia/sdp_mesh.j2       | 40 +++++++++----------
 5 files changed, 31 insertions(+), 29 deletions(-)
 create mode 120000 geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/ip_prefix_list.j2
 create mode 100644 geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_vprn.j2
 create mode 100644 geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_update_sdp.j2

diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/ip_prefix_list.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/ip_prefix_list.j2
new file mode 120000
index 00000000..c9c4c6df
--- /dev/null
+++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/ip_prefix_list.j2
@@ -0,0 +1 @@
+../../../../base_config/templates/routers/nokia/ip_prefix_list.j2
\ No newline at end of file
diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_config.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_config.j2
index b2b897bc..feebe23a 100644
--- a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_config.j2
+++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_config.j2
@@ -6,14 +6,5 @@
        {% include 'cflowd.j2' %}
        {% include 'router/router_base.j2' %}
        {% include 'sdp_mesh.j2' %}
-       {#{% include 'general.j2' %}#}
-       {#{% include 'chassis.j2' %}#}
-       {#{% include 'sfm.j2' %}#}
-       {#{% include 'cards.j2' %}#}
-       {#{% include 'connectors.j2' %}#}
-       {#{% include 'ntp.j2' %}#}
-       {#{% include 'syslog/syslog.j2' %}#}
-       {#{% include 'system/security/security.j2' %}#}
-       {#{% include 'qos/qos.j2' %}#}
    </configure>
 </config>
diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_vprn.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_vprn.j2
new file mode 100644
index 00000000..1ab52618
--- /dev/null
+++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_base_vprn.j2
@@ -0,0 +1,5 @@
+<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
+    <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
+       {% include 'router/vprn.j2' %}
+   </configure>
+</config>
diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_update_sdp.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_update_sdp.j2
new file mode 100644
index 00000000..5ffc1bde
--- /dev/null
+++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/pe_update_sdp.j2
@@ -0,0 +1,5 @@
+<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0">
+    <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf">
+       {% include 'sdp_mesh.j2' %}
+   </configure>
+</config>
diff --git a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/sdp_mesh.j2 b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/sdp_mesh.j2
index dc40ca87..45be0ab7 100644
--- a/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/sdp_mesh.j2
+++ b/geant/gap_ansible/roles/promote_p_to_pe/templates/routers/nokia/sdp_mesh.j2
@@ -1,20 +1,20 @@
-<service 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">
-    <sdp>
-        {% for pe_fqdn, pe_addr in pe_router_list.items() %}
-        {% set sdp_id = pe_addr.lo4 | replace(sdp_prefix_regex, '') | replace('.', '') + sdp_type.id %}
-        <sdp-id>{{ sdp_id }}</sdp-id>
-        <admin-state>enable</admin-state>
-        <description>SDP_{{ sdp_id }}</description>
-        <delivery-type>mpls</delivery-type>
-        <path-mtu>{{ sdp_type.path_mtu }}</path-mtu>
-        {% if sdp_type.signaling is defined %}
-        <signaling>{{ sdp_type.signaling}}</signaling>
-        {% endif %}
-        <sr-isis>{{ sdp_type.sr_isis | lower }}</sr-isis>
-        <far-end>
-            <ip-address>{{ pe_addr.lo4 }}</ip-address>
-        </far-end>
-        {% endfor %}
-    </sdp>
-</service>
-
+    <service 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">
+        <sdp>
+            {% for pe_fqdn, pe_addr in pe_router_list.items() %}
+            {% set sdp_id = pe_addr.lo4 | replace(sdp_prefix_regex, '') | replace('.', '') + sdp_type.id %}
+            <sdp-id>{{ sdp_id }}</sdp-id>
+            <admin-state>enable</admin-state>
+            <description>SDP_{{ sdp_id }}</description>
+            <delivery-type>mpls</delivery-type>
+            <path-mtu>{{ sdp_type.path_mtu }}</path-mtu>
+            {% if sdp_type.signaling is defined %}
+            <signaling>{{ sdp_type.signaling}}</signaling>
+            {% endif %}
+            <sr-isis>{{ sdp_type.sr_isis | lower }}</sr-isis>
+            <far-end>
+                <ip-address>{{ pe_addr.lo4 }}</ip-address>
+            </far-end>
+            {% endfor %}
+        </sdp>
+    </service>
+    
-- 
GitLab