fix: make assert test for netaddr actually return a boolean (#13304)

* fix: make assert test for netaddr actually return a boolean

The netaddr test returns a string when the netaddr is installed. This makes
Ansible 2.20 angry. Here's a fix to make sure the true case also returns a
boolean instead of a string.

* fix: more fixes for non-boolean conditions

The `cloud_provider` assertion change is a little more involved. The only two
allowed values are "" and "external". Let's just always check the assertion
instead of skipping it when it's the default value, which is "".

All the other changes should be fairly obvious.
This commit is contained in:
Wren Turkal
2026-06-14 01:26:32 -07:00
committed by GitHub
parent 3011e19ccd
commit f2a7181f99
2 changed files with 6 additions and 7 deletions

View File

@@ -21,7 +21,7 @@
- name: "Check that python netaddr is installed"
assert:
msg: "Python netaddr is not present"
that: "'127.0.0.1' | ansible.utils.ipaddr"
that: "'127.0.0.1' | ansible.utils.ipaddr == '127.0.0.1'"
tags:
- check