The snippet below evaluates to true, then false with myvar=false. How come?
ansible version 2.2.1.0 on OSX High Sierra
---
- name: do stuff without curlies
become: no
hosts: all
tasks:
- name: echo
shell: echo x
when: something == 'yes' and myvar
- name: do stuff with curlies
become: no
hosts: all
tasks:
- name: echo
shell: echo x
when: "{{ something == 'yes' and myvar }}"
$ ansible-playbook play.yml -c local -i 127.0.0.1, -e myvar=false -e
something="yes"
PLAY [do stuff without curlies]
************************************************
TASK [echo]
********************************************************************
Thursday 07 December 2017 10:15:48 +0000 (0:00:00.080) 0:00:00.080
*****
changed: [127.0.0.1]
PLAY [do stuff with curlies]
***************************************************
TASK [echo]
********************************************************************
Thursday 07 December 2017 10:15:49 +0000 (0:00:00.470) 0:00:00.551
*****
PLAY RECAP
*********************************************************************
127.0.0.1 : ok=1 changed=1 unreachable=0 failed=0
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e8797fba-0f35-4187-a8f8-60376486e6a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.