Error while evaluating conditional

50 views
Skip to first unread message

John Oliver

unread,
Dec 30, 2014, 1:20:00 PM12/30/14
to ansible...@googlegroups.com
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.

titlei...@gmail.com

unread,
Jan 1, 2015, 1:22:12 PM1/1/15
to ansible...@googlegroups.com
John,

What if you try this in your play?

- name: Configure firewall
  include: firewall.yml
  when: pg_host != "localhost"

Jay
Reply all
Reply to author
Forward
0 new messages