# Error while evaluating conditional with "and"

**URL:** <https://forum.ansible.com/t/error-while-evaluating-conditional-with-and/14236>\
**Category:** Ansible Project\
**Created:** [December 30, 2013, 3:33pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional-with-and/14236 "2013-12-30T15:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joost\_Cassee](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Joost\_Cassee](https://forum.ansible.com/u/Joost_Cassee)\
**Post date:** [December 30, 2013, 3:33pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional-with-and/14236/1 "2013-12-30T15:33:23Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 30, 2013, 3:39pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional-with-and/14236/2 "2013-12-30T15:39:51Z")

</div>

The problem is with the way you set your ‘vars’ up. You probably want:

vars:  
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’

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 30, 2013, 4:32pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional-with-and/14236/3 "2013-12-30T16:32:04Z")

</div>

when in doubt, the debug statement is useful!

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