Last active
March 3, 2017 14:37
-
-
Save hughsaunders/c69c4ce8e06d9e5507ef7a5469ad5027 to your computer and use it in GitHub Desktop.
ansible string bools behave differently when part of an expression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible-playbook -i inventory/ test.yml | |
PLAY [localhost] *************************************************************** | |
TASK [debug] ******************************************************************* | |
skipping: [localhost] | |
TASK [debug] ******************************************************************* | |
skipping: [localhost] | |
TASK [debug] ******************************************************************* | |
skipping: [localhost] | |
TASK [debug] ******************************************************************* | |
ok: [localhost] => { | |
"msg": "quote in expression" | |
} | |
TASK [debug] ******************************************************************* | |
skipping: [localhost] | |
TASK [debug] ******************************************************************* | |
skipping: [localhost] | |
PLAY RECAP ********************************************************************* | |
localhost : ok=1 changed=0 unreachable=0 failed=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: False | |
vars: | |
upper: False | |
lower: false | |
quote: "False" | |
tasks: | |
- debug: | |
msg: "upper" | |
when: upper | |
- debug: | |
msg: "lower" | |
when: lower | |
- debug: | |
msg: "quote" | |
when: quote | |
- debug: | |
msg: "quote in expression" | |
when: quote and true | |
- debug: | |
msg: "lower in expression" | |
when: lower and true | |
- debug: | |
msg: "upper in expression" | |
when: upper and true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment