From 4e065de31d3029b1197a3edde699e6e67f9df110 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 10 Mar 2025 13:49:37 +0100 Subject: [PATCH] MT#61541 Fix redis IP checks We should not repeat the loopback IP in case it appears in the ha_int_ips. Use a dedicated array to track it, so that we can sort and filter it. The duplication has been present for a long time, but with newer goss, it now fails. Change-Id: I8f79551f74675607ba803605d8b83949dcf8a599 --- templates/821_network-ports-ngcp.yaml.tt2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/821_network-ports-ngcp.yaml.tt2 b/templates/821_network-ports-ngcp.yaml.tt2 index 0045bc7..153286d 100644 --- a/templates/821_network-ports-ngcp.yaml.tt2 +++ b/templates/821_network-ports-ngcp.yaml.tt2 @@ -65,6 +65,9 @@ argv.type = 'ha_int'; PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; ha_int_ips = out; + + redis_ips = ['127.0.0.1', ha_int_ips.0]; + redis_ips = redis_ips.sort.unique; -%] port: @@ -230,7 +233,10 @@ port: # Redis tcp:6379: listening: true - ip: ["127.0.0.1", "[% ha_int_ips.0 %]"] + ip: +[% FOREACH ip IN redis_ips -%] + - "[% ip %]" +[% END -%] tcp6:6379: listening: true ip: ["::1"]