From b3040225e7300b3af013039f97eefd09bbeef68e Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Sat, 26 Oct 2024 09:05:38 +0100
Subject: [PATCH] Adding IES into PE base-config

---
 .../roles/bc_templates/routers/nokia/base_config.j2   |  2 +-
 .../routers/nokia/pe_promotion_base_vprn.j2           |  2 +-
 .../roles/bc_templates/routers/nokia/router/ies.j2    | 11 +++++++++++
 .../routers/nokia/{service_vprn.j2 => service.j2}     |  1 +
 4 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 geant/gap_ansible/roles/bc_templates/routers/nokia/router/ies.j2
 rename geant/gap_ansible/roles/bc_templates/routers/nokia/{service_vprn.j2 => service.j2} (94%)

diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2
index 12bb30fd..ab210fa5 100644
--- a/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2
+++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/base_config.j2
@@ -15,7 +15,7 @@
        {% include 'cflowd.j2' %}
        {% include 'filter_log.j2' %}
        {% include 'policy_options/policy_options.j2' %}
-       {% include 'service_vprn.j2' %}
+       {% include 'service.j2' %}
        {% include 'router/routing_options.j2' %}
     {% endif %}
     {# This is because `ip_prefix_list` is related to what defined in VPRN apply_paths #}
diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/pe_promotion_base_vprn.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/pe_promotion_base_vprn.j2
index f8467b33..869fbfe7 100644
--- a/geant/gap_ansible/roles/bc_templates/routers/nokia/pe_promotion_base_vprn.j2
+++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/pe_promotion_base_vprn.j2
@@ -1,5 +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 'service_vprn.j2' %}
+       {% include 'service.j2' %}
    </configure>
 </config>
diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ies.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ies.j2
new file mode 100644
index 00000000..2a024feb
--- /dev/null
+++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/router/ies.j2
@@ -0,0 +1,11 @@
+{% for ies in pe_ies %}
+<ies 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">
+    <service-name>{{ ies.name }}</service-name>
+    <admin-state>{{ ies.admin_state | default('enable') }}</admin-state>
+    {% if ies.description is defined %}
+    <description>{{ ies.description }}</description>
+    {% endif %}
+    <service-id>{{ ies.service_id }}</service-id>
+    <customer>{{ ies.customer_id }}</customer>
+</ies>
+{% endfor %}
diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/service.j2
similarity index 94%
rename from geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2
rename to geant/gap_ansible/roles/bc_templates/routers/nokia/service.j2
index b588b730..8959e97a 100644
--- a/geant/gap_ansible/roles/bc_templates/routers/nokia/service_vprn.j2
+++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/service.j2
@@ -6,6 +6,7 @@
             <end>{{ pe_service.md_auto_id.service_id_range.end | default('19999') }}</end>
         </service-id-range>
     </md-auto-id>
+    {% include 'router/ies.j2' %}
     {% include 'router/vprn.j2' %}
 </service>
 {% if is_pe_promotion_wf %}
-- 
GitLab