mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-02-24 10:13:30 +07:00
Few improvements(#33)
* README update * Remove useless legacy files * Small refactoring for Galera Cluster * Modern Ansible * Some changes on travis + Vagrant * Help debug: display all facts * Fix galera config for docker
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
---
|
||||
|
||||
- name: INCLUDE | Replication Master
|
||||
include: master.yml
|
||||
import_tasks: master.yml
|
||||
when: mariadb_replication_master
|
||||
|
||||
- name: INCLUDE | Replication slave
|
||||
include: slave.yml
|
||||
import_tasks: slave.yml
|
||||
when: mariadb_replication_slave
|
||||
|
||||
@@ -19,19 +19,19 @@
|
||||
register: slave_status
|
||||
|
||||
- name: INCLUDE | Transfert /etc/mysql/debian.cnf from master
|
||||
include: slave/ssh.yml
|
||||
import_tasks: slave/ssh.yml
|
||||
when: mariadb_slave_replicate_mysqldb or ((slave_status.failed is defined or not slave_status.Is_Slave) and mariadb_slave_import_data)
|
||||
|
||||
- name: INCLUDE | Import data
|
||||
include: slave/import_data.yml
|
||||
import_tasks: slave/import_data.yml
|
||||
when: (slave_status.failed is defined or not slave_status.Is_Slave) and mariadb_slave_import_data
|
||||
|
||||
- name: INCLUDE | Configure replication
|
||||
include: slave/replication.yml
|
||||
import_tasks: slave/replication.yml
|
||||
when: (slave_status.failed is defined or not slave_status.Is_Slave) or mariadb_slave_force_setup
|
||||
|
||||
- name: INCLUDE | Transfert /etc/mysql/debian.cnf from master
|
||||
include: slave/debiancnf.yml
|
||||
import_tasks: slave/debiancnf.yml
|
||||
when: mariadb_slave_replicate_mysqldb
|
||||
|
||||
- name: MYSQL_REPLICATION | Get slave status
|
||||
@@ -41,4 +41,4 @@
|
||||
register: slave_status
|
||||
|
||||
- name: Configure GTID
|
||||
include: slave/gtid.yml
|
||||
import_tasks: slave/gtid.yml
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
delegate_to: "{{ mariadb_slave_import_from }}"
|
||||
|
||||
- name: LOCAL_ACTION FILE | Secure fetched file
|
||||
local_action: file path=/tmp/{{ mariadb_slave_import_from }}/debian.cnf mode=0600
|
||||
local_action:
|
||||
module: file
|
||||
path: "/tmp/{{ mariadb_slave_import_from }}/debian.cnf"
|
||||
mode: 0600
|
||||
become: no
|
||||
|
||||
- name: COPY | Fetched file to /etc/mysql/debian.cnf
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
port: 22
|
||||
|
||||
- name: COMMAND | Prepare backup another server
|
||||
command: innobackupex --no-timestamp {{ mariadb_backup_dir }} creates={{ mariadb_backup_dir }}
|
||||
command: innobackupex --no-timestamp {{ mariadb_backup_dir }}
|
||||
args:
|
||||
creates: "{{ mariadb_backup_dir }}"
|
||||
delegate_to: "{{ mariadb_slave_import_from }}"
|
||||
register: backup
|
||||
|
||||
@@ -24,7 +26,8 @@
|
||||
when: backup.changed and not mariadb_slave_replicate_mysqldb
|
||||
|
||||
- name: MYSQL_VARIABLES | Get datadir
|
||||
mysql_variables: variable=datadir
|
||||
mysql_variables:
|
||||
variable: datadir
|
||||
register: datadir
|
||||
|
||||
- name: SET_FACT | related to mysql datadir
|
||||
@@ -74,6 +77,8 @@
|
||||
mariadb_master_gtid: "{{ master_gtid.stdout }}"
|
||||
|
||||
- name: FILE | Delete dump
|
||||
file: path={{ mariadb_backup_dir }} state=absent
|
||||
file:
|
||||
path: "{{ mariadb_backup_dir }}"
|
||||
state: absent
|
||||
delegate_to: "{{ mariadb_slave_import_from }}"
|
||||
when: mariadb_slave_import_flush_dump
|
||||
|
||||
Reference in New Issue
Block a user