From e3fe7ec4501b659051b32359a03eeb637516a71a Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Fri, 18 Apr 2025 18:07:40 +0200 Subject: [PATCH] Fix condition evaluation on ansible_all_ipv6_addresses to have a Boolean result (#404) The condition `when: ansible_all_ipv6_addresses` evaluates to a list, which in term evaluates to True, but it seems that more recent Ansible versions do not accept that anymore: ``` Conditional result was "['fe80::...']" of type 'list', which evaluates to True. Conditionals must have a boolean result. ``` This commit adds a length check to create a real Boolean result. Signed-off-by: Stefan Haun --- roles/prereq/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/prereq/tasks/main.yml b/roles/prereq/tasks/main.yml index a7c3aa8..e451295 100644 --- a/roles/prereq/tasks/main.yml +++ b/roles/prereq/tasks/main.yml @@ -24,7 +24,7 @@ value: "1" state: present reload: true - when: ansible_all_ipv6_addresses + when: ansible_all_ipv6_addresses | length > 0 - name: Populate service facts ansible.builtin.service_facts: