From d0ef101dd236ab1a01a77b880d7321681080256f Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <ak@geant.org>
Date: Mon, 2 Dec 2024 14:31:20 +0000
Subject: [PATCH] GRPC config in general with condition

---
 .../gap_ansible/roles/bc_templates/routers/nokia/general.j2 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2 b/geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2
index 7a4d3027..3573a421 100644
--- a/geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2
+++ b/geant/gap_ansible/roles/bc_templates/routers/nokia/general.j2
@@ -10,13 +10,15 @@
         <lsr-load-balancing>lbl-ip-l4-teid</lsr-load-balancing>
         <system-ip-load-balancing>true</system-ip-load-balancing>
     </load-balancing>
-    <grpc>
+    {% if grpc_enabled %}
+    <grpc alu:operation="replace">
         <admin-state>enable</admin-state>
         <allow-unsecure-connection></allow-unsecure-connection>
         <gnmi>
             <auto-config-save>true</auto-config-save>
         </gnmi>
     </grpc>
+    {% endif %}
     <login-control>
         <motd>
             <text alu:operation="replace">{{ nokia_motd }}</text>
@@ -25,7 +27,7 @@
             <message alu:operation="replace">{{ nokia_pre_login_msg }}</message>
         </pre-login-message>
         <ssh>
-            <inbound-max-sessions>{{ nokia_ssh_config.inbound_max_sess }}</inbound-max-sessions>
+            <inbound-max-sessions alu:operation="replace">{{ nokia_ssh_config.inbound_max_sess }}</inbound-max-sessions>
         </ssh>
     </login-control>
     <management-interface alu:operation="replace">
-- 
GitLab