mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
56148291e9
This change is related to reported issue #14291 and pull request #14293. Without the fix from #14293, this change will emit a warning as shown below, on the following playbook: ``yaml --- - hosts: localhost gather_facts: no vars: works: key1: 'string' key2: 1234 fails: key1: 'string' key2: 1234 key3: false tasks: - debug: msg={{ works | to_json }} - debug: msg={{ fails | to_json }} ``` On error, this results in a proper warning: ``` [dag@moria ansible.dag]$ ansible-playbook test49.yml PLAY *************************************************************************** TASK [debug] ******************************************************************* ok: [localhost] => { "msg": { "key1": "string", "key2": 1234 } } TASK [debug] ******************************************************************* [WARNING]: Error in expression "{"key3": false, "key2": 1234, "key1": "string"}". (name 'false' is not defined) ok: [localhost] => { "msg": "{\"key3\": false, \"key2\": 1234, \"key1\": \"string\"}" } PLAY RECAP ********************************************************************* localhost : ok=2 changed=0 unreachable=0 failed=0 ``` |
||
---|---|---|
.. | ||
ansible |