From 675ad8194e8b22f94503c6c9b28cf3312a00385c Mon Sep 17 00:00:00 2001
From: Aleksandr Kurbatov <aleksandr.kurbatov@GL1342.local>
Date: Fri, 3 May 2024 18:03:42 +0100
Subject: [PATCH] iptrunk_twamp: update to Nokia server prefix

Prefix should be the whole trunk subnet and not the remote Juniper side
only (according to Eric).
---
 .../roles/iptrunk_twamp/tasks/check_twamp_status.yaml         | 4 ++--
 .../roles/iptrunk_twamp/templates/nokia/twamp_server.j2       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/geant/gap_ansible/roles/iptrunk_twamp/tasks/check_twamp_status.yaml b/geant/gap_ansible/roles/iptrunk_twamp/tasks/check_twamp_status.yaml
index 80f39f9c..8a410925 100644
--- a/geant/gap_ansible/roles/iptrunk_twamp/tasks/check_twamp_status.yaml
+++ b/geant/gap_ansible/roles/iptrunk_twamp/tasks/check_twamp_status.yaml
@@ -12,7 +12,7 @@
     - name: Get TWAMP client stats
       junipernetworks.junos.junos_command:
         commands:
-          - show services rpm twamp client probe-results control-connection "{{ local_side_short_name }}--{{ remote_side_short_name }}" test-session "{{ local_side_short_name }}--{{ remote_side_short_name }}" | except "Measurement|Samples"
+          - show services rpm twamp client probe-results control-connection "{{ local_side_short_name }}--{{ remote_side_short_name }}" test-session "{{ local_side_short_name }}--{{ remote_side_short_name }}"
       register: response
 
     - name: Show stats of TWAMP client
@@ -32,7 +32,7 @@
         content: |
             <global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
               <md-cli-raw-command>
-              <md-cli-input-line>show test-oam twamp server prefix "{{ remote_side_address }}/32"</md-cli-input-line>
+              <md-cli-input-line>show test-oam twamp server prefix "{{ subscription.iptrunk.iptrunk_ipv4_network }}"</md-cli-input-line>
               </md-cli-raw-command>
             </global-operations>
         display: json
diff --git a/geant/gap_ansible/roles/iptrunk_twamp/templates/nokia/twamp_server.j2 b/geant/gap_ansible/roles/iptrunk_twamp/templates/nokia/twamp_server.j2
index ad0a3ba4..57bb24ec 100644
--- a/geant/gap_ansible/roles/iptrunk_twamp/templates/nokia/twamp_server.j2
+++ b/geant/gap_ansible/roles/iptrunk_twamp/templates/nokia/twamp_server.j2
@@ -5,7 +5,7 @@
             <server>
                 <admin-state>enable</admin-state>
                 <prefix alu:operation="replace">
-                    <ip-prefix>{{ remote_side_address }}/32</ip-prefix>
+                    <ip-prefix>{{ subscription.iptrunk.iptrunk_ipv4_network }}</ip-prefix>
                     <description>{{ remote_side_short_name }}</description>
                     <max-connections>{{ nokia_twamp_server.max_conn }}</max-connections>
                     <max-sessions>{{ nokia_twamp_server.max_sess }}</max-sessions>
-- 
GitLab