Compare the ip var with local IPs as addresses (#13577)

Signed-off-by: Ali Afsharzadeh <afsharzadeh8@gmail.com>
This commit is contained in:
Ali Afsharzadeh
2026-09-26 09:36:28 +00:00
committed by GitHub
parent 90f7c2505f
commit ac72c82651
@@ -55,7 +55,7 @@
- name: Stop if ip var does not match local ips
assert:
that: (ip in ansible_facts['all_ipv4_addresses']) or (ip in ansible_facts['all_ipv6_addresses'])
that: ip | ansible.utils.ipaddr in (ansible_facts['all_ipv4_addresses'] + ansible_facts['all_ipv6_addresses'])
msg: "IPv4: '{{ ansible_facts['all_ipv4_addresses'] }}' and IPv6: '{{ ansible_facts['all_ipv6_addresses'] }}' do not contain '{{ ip }}'"
when:
- not ignore_assert_errors