On 07.12.2017 11:18, jepper wrote:
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 }}"
You can't use double curly brackets in when, in when you are in template
mode already so the double curly brackets is implied.
--
Kai Stian Olstad
--
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/c43baf187e6d251d4cd2c9d0a295d25f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.