All,
I’m running Ansible latest from github.
You can see the full example here:
http://pastebin.com/LpKdhRBD
But I have a conditional from a variable I’ve registered. I took the example pretty much straight out of http://ansible.cc/docs/playbooks2.html#register-variables.
- name: create wordpress database
command: sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress {{ host }}
when: mysql_dbs.find(‘wordpress’) != -1
Every time I run the above, I get back the error:
Conditional expression must evaluate to True or False: {% if (mysql_dbs.find(‘wordpress’) != -1) %} True {% else %} False {% endif %}
I’ve tried it, with the brackets, without the brackets, as ‘-1’ and -1. I’m not sure what I’ve done wrong here.
Can someone please point me in the right direction?
Thanks!
Mark