when in doubt, the debug statement is useful!

- debug: var=a
- debug: var=b




On Mon, Dec 30, 2013 at 10:39 AM, Matt Martz <m...@sivel.net> wrote:

> The problem is with the way you set your 'vars' up.  You probably want:
>
> vars:
>     a: yes
>     b: yes
>
> Starting a line with a '-' tells it that you are defining a list.  However
> in this specific case, it just ignores the definition of 'b'.  So due to
> your vars not actually being defined you get 'error while evaluating
> conditional: a and b'
> --
> Matt Martz
> m...@sivel.net
>
> On December 30, 2013 at 9:33:25 AM, Joost Cassee 
> (jo...@cassee.net<//jo...@cassee.net>)
> wrote:
>
> Hi,
>
> This is probably a very silly mistake on my part, but I cannot seem to get
> con-/disjunctions working in when statements. See this setup:
>
> hosts:
> ---
>  localhost
>  ---
>
> playbook.yml:
> ---
>  ---
> - hosts: localhost
>   gather_facts: no
>   connection: local
>   vars:
>   - a: yes
>     b: yes
>   tasks:
>   - action: ping
>     when: a and b
>  ---
>
> Running the playbook:
> ---
> $ ansible-playbook playbook.yml -i hosts
>
>  PLAY [localhost]
> **************************************************************
>
> TASK: [ping]
> ******************************************************************
> fatal: [localhost] => error while evaluating conditional: a and b
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP
> ********************************************************************
>            to retry, use: --limit @/home/joost/playbook.retry
>
> localhost                  : ok=0    changed=0    unreachable=1
>  failed=0
>  ---
>
> What am I missing?
>
> Regards,
> Joost
>  --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>  --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Michael DeHaan <mich...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to