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

16 lines
533 B
YAML

---
# This starts the galera cluster
# Check if mysql is running
- name: bootstrap by starting mysql with gcom://
action: shell /etc/init.d/mysql start --wsrep-cluster-address="gcomm://"
only_if: ${is_mysql_running.rc} > 0
- name: Create wrestlingtourney database
action: shell mysql -e "CREATE DATABASE wrestlingtourney;"
- name: set mysql root password
action: shell mysql -e "UPDATE mysql.user SET password=PASSWORD('$root_mysql_password') where user='root'; FLUSH PRIVILEGES;"
only_if: $(is_mysql_running.rc} > 0