From 256510c12be85dcabcb46ad3d794649004660746 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 12 Dec 2019 19:13:55 +0100 Subject: [PATCH] TT#72351 Fix DNS match on CARRIER We hardcode the list of hosts to avoid relying on possibly broken network.yml files. Change-Id: I4a6f91ff09c7b446391aea13d51eb984ccc74242 --- templates/812_network-dns-ngcp-pro.yaml.tt2 | 32 ++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/templates/812_network-dns-ngcp-pro.yaml.tt2 b/templates/812_network-dns-ngcp-pro.yaml.tt2 index 837d7db..07abeca 100644 --- a/templates/812_network-dns-ngcp-pro.yaml.tt2 +++ b/templates/812_network-dns-ngcp-pro.yaml.tt2 @@ -1,12 +1,30 @@ +[%- + # Hardcode the list of hosts, so that we can ignore any issue in major + # network.yml due to missing entries. + IF general.ngcp_type == 'carrier'; + # On a CARRIER we assume at least these host must be present. + hostlist = [ + 'web01a', 'web01b', 'db01a', 'db01b', + 'prx01a', 'prx01b', 'lb01a', 'lb01b', + ]; + ELSIF general.ngcp_type == 'sppro'; + hostlist = [ 'sp1', 'sp2' ]; + END; +-%] dns: - sp1: +[% FOR hostname IN hostlist -%] + [% hostname %]: resolvable: true addrs: - - 192.168.255.251 +[%- + # If this library function is broken, we will get at worst an empty value + # which should also make the check fail. + argv.host = hostname; + argv.type = 'ha_int'; + PROCESS '/usr/lib/ngcp-ngcpcfg/get_all_ips_for_host'; + ha_ip = out; +%] + - [% ha_ip.0 %] timeout: 500 - sp2: - resolvable: true - addrs: - - 192.168.255.252 - timeout: 500 +[% END -%]