Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #install_wordpress/tasks/main.yml
- ---
- - name: install wordpress
- apt: pkg=wordpress state=latest
- - name: store mysql database list
- shell: echo 'show databases;' | sudo mysql --host={{ mysql_host }}
- register: mysql_dbs
- - name: create wordpress database
- command: sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress {{ mysql_host }}
- when: (mysql_dbs.find('wordpress') != -1)
- # Error message:
- TASK: [store mysql database list] *********************************************
- changed: [172.16.230.133] => {"changed": true, "cmd": "echo 'show databases;' | sudo mysql --host=localhost ", "delta": "0:00:00.006955", "end": "2013-05-21 01:41:43.245194", "item": "", "rc": 0, "start": "2013-05-21 01:41:43.238239", "stderr": "", "stdout": "Database\ninformation_schema\nmysql\nperformance_schema\ntest"}
- TASK: [create wordpress database] *********************************************
- fatal: [172.16.230.133] => Conditional expression must evaluate to True or False: {% if (mysql_dbs.find('wordpress') != -1) %} True {% else %} False {% endif %}
- FATAL: all hosts have already failed -- aborting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement