Created
July 12, 2017 12:29
-
-
Save berlic/2fd91e9925c66419d5d27b3a5111cbde to your computer and use it in GitHub Desktop.
bool conversion demo
This file contains 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: no | |
tasks: | |
- debug: msg=var1 | |
when: var1 | |
- debug: msg=var2 | |
when: var2 | |
- debug: msg=both | |
when: var1 or var2 | |
- debug: msg=both2 | |
when: var1 | bool or var2 | bool |
msg=both
will fire in spite of having both vars set to "false"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
execute with
ansible-playbook -vv -e var1=false -e var2=false playbook.yml