Error while evaluating conditional

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.

John,

What if you try this in your play?

  • name: Configure firewall
    include: firewall.yml
    when: pg_host != “localhost”

Jay