From f376ae079519c0425d76e53022801754560ac7e7 Mon Sep 17 00:00:00 2001 From: Will Szumski Date: Thu, 25 Sep 2025 09:34:16 +0100 Subject: [PATCH] Network connectivity: Fix regression with noip When using no_ip on all hosts on a given network, the _ips key will not exist in network-allocations.yml at all, so we need to tolerate this key not existing. Closes-Bug: #2125560 Change-Id: I1b71990af38a8fd6c6258a49d2b94e16496fb274 Signed-off-by: Will Szumski --- ansible/network-connectivity.yml | 2 +- ...gression-network-connectivity-no-ip-a37a2d97379a93e7.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fixes-regression-network-connectivity-no-ip-a37a2d97379a93e7.yaml diff --git a/ansible/network-connectivity.yml b/ansible/network-connectivity.yml index 797d0f096..2d8d2ccdd 100644 --- a/ansible/network-connectivity.yml +++ b/ansible/network-connectivity.yml @@ -91,5 +91,5 @@ # in the command. Assumption was that this was being evaluated once # for the when clause and then again for the command. Bug? remote_host: "{{ remote_hosts | random(seed=ansible_facts.date_time.iso8601) }}" - remote_ip: "{{ lookup('cached', 'vars', item ~ '_ips')[remote_host] | default('', true) }}" + remote_ip: "{{ lookup('cached', 'vars', item ~ '_ips', default={})[remote_host] | default('', true) }}" mtu: "{{ item | net_mtu }}" diff --git a/releasenotes/notes/fixes-regression-network-connectivity-no-ip-a37a2d97379a93e7.yaml b/releasenotes/notes/fixes-regression-network-connectivity-no-ip-a37a2d97379a93e7.yaml new file mode 100644 index 000000000..c75267ba7 --- /dev/null +++ b/releasenotes/notes/fixes-regression-network-connectivity-no-ip-a37a2d97379a93e7.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes a regression in network connectivity check when using the ``no_ip`` + attribute. `LP#2125560 `__