#ansible #iac

Ansible casting None to bool

Who would have though that Ansible behvior when casting null to bool will be closer to SQL than to Python:

$ python -c "print(bool(None))"
False

$ psql -tA -c "select null::bool is null"
t

$ ansible -o -m raw -a "echo -n {{ None | bool | type_debug }}" localhost
localhost | CHANGED | rc=0 | (stdout) NoneType