Template for master slave mariadb configuration
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
---
|
||||
# This installs mariadb and galera on db nodes
|
||||
# https://mariadb.com/blog/devops-mariadb-part-1
|
||||
# https://mariadb.com/blog/devops-mariadb-and-ansible-part-2
|
||||
|
||||
- name: Update apt
|
||||
apt: update_cache=yes
|
||||
@@ -7,15 +9,23 @@
|
||||
- name: Install software properties
|
||||
apt: name=software-properties-common state=present
|
||||
|
||||
- name: Add galera apt repo
|
||||
apt_key: url=hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
|
||||
apt_repository: repo='deb [arch=amd64,i386] http://ftp.osuosl.org/pub/mariadb/repo/10.1/ubuntu trusty main'
|
||||
- name: Install MariaDB repository
|
||||
apt_repository: repo='deb http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.1/ubuntu trusty main' state=present
|
||||
|
||||
- name: Update apt
|
||||
apt: udpate_cache=yes
|
||||
- name: Add repository key to the system
|
||||
apt_key: keyserver=keyserver.ubuntu.com id=0xcbcb082a1bb943db
|
||||
|
||||
- name: Install mariadb
|
||||
apt: name=mariadb-server state=present
|
||||
- name: Install MariaDB Server
|
||||
apt: name=mariadb-server state=latest update_cache=yes
|
||||
|
||||
- name: Install python module
|
||||
apt: name=python-mysqldb state=installed
|
||||
|
||||
- name: Create replication account
|
||||
mysql_user: name=repl host="%" password={{ replication_password }} priv=*.*:"REPLICATION SLAVE" state=present
|
||||
|
||||
- name: Create readwrite user
|
||||
mysql_user: name=rwuser host="%" password={{ read_write_password }} priv=*.*:SELECT,INSERT,UPDATE,DELETE,CREATE,DROP state=present
|
||||
|
||||
- name: Modify configuration file to listen on all interfaces
|
||||
lineinfile: dest=/etc/mysql/my.cnf regexp="^bind-address" line="bind-address=0.0.0.0"
|
||||
|
||||
Reference in New Issue
Block a user