# Error while evaluating conditional

**URL:** <https://forum.ansible.com/t/error-while-evaluating-conditional/17162>\
**Category:** Ansible Project\
**Created:** [December 30, 2014, 6:20pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional/17162 "2014-12-30T18:20:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Oliver](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@John\_Oliver](https://forum.ansible.com/u/John_Oliver)\
**Post date:** [December 30, 2014, 6:20pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional/17162/1 "2014-12-30T18:20:00Z")

</div>

ansible 1.7.2

My play:

- name: Configure firewall  
include: firewall.yml  
when: “{{pg\_host}} != localhost”

gets me:

TASK: [postgres | Check if postgres is already allowed via IPv4] \*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [jedis-test] =\> error while evaluating conditional: localhost != localhost

This looks like a case where ansible could maybe be a little more verbose? The line that’s failing is the first play in firewall.yml I’m guessing I’m just not clear on how to run another playbook if my variable is not equal to localhost.

---

<div class="post-metadata">

**Author:** ![titleistfour](https://avatars.discourse-cdn.com/v4/letter/t/65b543/32.png) [@titleistfour](https://forum.ansible.com/u/titleistfour)\
**Post date:** [January 1, 2015, 6:22pm UTC](https://forum.ansible.com/t/error-while-evaluating-conditional/17162/2 "2015-01-01T18:22:12Z")

</div>

John,

What if you try this in your play?

- name: Configure firewall  
include: firewall.yml  
when: pg\_host != “localhost”

Jay
