Advertisement
Guest User

Untitled

a guest
May 21st, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.11 KB | None | 0 0
  1. #install_wordpress/tasks/main.yml
  2.  
  3. ---
  4. - name: install wordpress
  5.   apt: pkg=wordpress state=latest
  6. - name: store mysql database list
  7.   shell: echo 'show databases;' | sudo mysql --host={{ mysql_host }}
  8.   register: mysql_dbs
  9. - name: create wordpress database
  10.   command: sudo bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress {{ mysql_host }}
  11.   when: (mysql_dbs.find('wordpress') != -1)
  12.  
  13. # Error message:
  14. TASK: [store mysql database list] *********************************************
  15. 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"}
  16.  
  17. TASK: [create wordpress database] *********************************************
  18. fatal: [172.16.230.133] => Conditional expression must evaluate to True or False: {% if (mysql_dbs.find('wordpress') != -1) %} True {% else %} False {% endif %}
  19.  
  20. FATAL: all hosts have already failed -- aborting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement