[ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Roman Revyakin
Hi, I am not sure whether someone has come across this issue previously - trying to search the group for 'when' and 'is defined' did not yield me anything useful. So I am posting it as a new topic here. I have encountered that in case I use 'when:' clause where I need to test whether one

Re: [ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Adam Heath
false != false. You have a string/boolean issue. Aka, the var1 is not the boolean value false, but the string value false. On 02/03/2014 06:32 PM, Roman Revyakin wrote: Hi, I am not sure whether someone has come across this issue previously - trying to search the group for 'when' and 'is

Re: [ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Roman Revyakin
Hi Adam, I do not think so, please see my example above with the ansible-playbook -i host -v test_playbook.yaml --extra-vars var1=false var2='something' being executed as expected (skipped). In case var1 was a string, the when: var2 is defined when: var1 conditions would evaluate

Re: [ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Jesse Keating
On 2/3/14, 4:32 PM, Roman Revyakin wrote: cat test_playbook.yaml EOF --- - hosts: all gather_facts: false tasks: - name: Play only if var1 is true and var2 is defined local_action: command echo Yes {{ var1 }} is true and {{ var2 }} is defined when: var1 and var2 is

Re: [ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Roman Revyakin
Hi Jesse, Thanks for getting to the bottom of this and providing a working solution! Works as charm indeed! Jinja framework is crazy IMHO. Adam: grouping does not help, I tried it before submitting my first request, as well as swapping the order. The issue is solved, thank you! I wonder what is

Re: [ansible-project] Conditionals - when: var1 and var2 is defined works in a weird way

2014-02-03 Thread Jesse Keating
On 2/3/14, 7:00 PM, Roman Revyakin wrote: The issue is solved, thank you! I wonder what is the process of altering documentation on docs.ansible.com http://docs.ansible.com, googling for it provided me a link which does not contain the text that is shown in the search preview. Does submitting