-
Notifications
You must be signed in to change notification settings - Fork 3
/
mysql.yml
50 lines (46 loc) · 1.69 KB
/
mysql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: all
become: True
tasks:
- name: Install Percona Repo
yum:
name: https://repo.percona.com/yum/percona-release-latest.noarch.rpm
state: present
- name: Install Percona Server
yum:
name: "{{ item }}"
state: present
with_items:
- Percona-XtraDB-Cluster-57.x86_64
- vim
- ntp
- name: Enable binlogs
ini_file:
path: /etc/my.cnf
section: mysqld
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- { option: log_bin, value: "binlog" }
- { option: binlog_format, value: "row" }
- { option: log_slave_updates, value: "1" }
- name: Galera configuration
ini_file:
path: /etc/my.cnf
section: mysqld
option: "{{ item.option }}"
value: "{{ item.value }}"
with_items:
- { option: wsrep_provider, value: "/usr/lib64/galera3/libgalera_smm.so" }
- { option: wsrep_cluster_name, value: "dani-cluster" }
- { option: wsrep_node_address, value: "{{ ansible_facts.eth1.ipv4.address }}" }
- { option: wsrep_node_name, value: "{{ ansible_hostname }}" }
- { option: wsrep_cluster_address, value: "gcomm://192.168.80.10,192.168.80.20,192.168.80.30" }
- { option: wsrep_sst_method, value: "xtrabackup-v2" }
- { option: wsrep_sst_auth, value: "root:cocacola" }
- { option: innodb_autoinc_lock_mode, value: "2" }
- { option: default_storage_engine, value: "InnoDB" }
- { option: server_id, value: "10" }
- name: Disable SELinux
shell: |
sudo setenforce 0