Files
wrestlingdev-ansible/roles/db/tasks/startcluster.yml

21 lines
783 B
YAML

---
# This starts the galera cluster
# Check if mysql is running
- name: bootstrap by starting mysql with new cluster
action: shell service mysql start --wsrep-new-cluster
- name: Create wrestlingtourney database
action: shell mysql -e "CREATE DATABASE wrestlingtourney;"
- name: Set up haproxy_check user
action: shell mysql -e "CREATE USER 'haproxy_check'@'%'; FLUSH PRIVILEGES;"
- name: Set up user for wrestlingtourney
action: shell mysql -e "CREATE USER 'heroku_jcw'@'%' IDENTIFIED BY '{{ heroku_jcw_password }}';GRANT ALL PRIVILEGES ON wrestlingtourney.* TO 'heroku_jcw'@'%'; FLUSH PRIVILEGES;"
- name: set mysql root password
action: shell mysql -e "UPDATE mysql.user SET password=PASSWORD('{{ root_mysql_password }}') where user='root'; FLUSH PRIVILEGES;"