debian.cnf needs to be consistent across all db nodes

This commit is contained in:
2016-02-16 09:48:51 -05:00
parent 18fcad80d9
commit bfae0a52a2
3 changed files with 33 additions and 12 deletions

View File

@@ -24,6 +24,26 @@
- name: Replace config file - name: Replace config file
template: src=../roles/db/templates/my.cnf.j2 dest=/etc/mysql/my.cnf template: src=../roles/db/templates/my.cnf.j2 dest=/etc/mysql/my.cnf
- name: Create wrestlingtourney database
action: shell mysql -e "CREATE DATABASE wrestlingtourney;"
ignore_errors: yes
- name: Set up haproxy_check user
action: shell mysql -e "CREATE USER 'haproxy_check'@'%'; FLUSH PRIVILEGES;"
ignore_errors: yes
- 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;"
ignore_errors: yes
- name: set mysql root password
action: shell mysql -e "UPDATE mysql.user SET password=PASSWORD('{{ root_mysql_password }}') where user='root'; FLUSH PRIVILEGES;"
ignore_errors: yes
- name: Stop mysql service - name: Stop mysql service
service: name=mysql state=stopped service: name=mysql state=stopped
- name: Replace debian config file
template: src=../roles/db/templates/debian.cnf.j2 dest=/etc/mysql/debian.cnf

View File

@@ -5,16 +5,4 @@
- name: bootstrap by starting mysql with new cluster - name: bootstrap by starting mysql with new cluster
action: shell service mysql start --wsrep-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;"

View File

@@ -0,0 +1,13 @@
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = root
password = {{ root_mysql_password }}
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password = {{ root_mysql_password }}
socket = /var/run/mysqld/mysqld.sock
basedir = /usr