parent
f7235d38b9
commit
239ce0dd6c
|
@ -64,6 +64,7 @@
|
||||||
community.mysql.mysql_db:
|
community.mysql.mysql_db:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
loop: "{{ mariadb_databases }}"
|
loop: "{{ mariadb_databases }}"
|
||||||
|
|
||||||
- name: MYSQL_USER | Manages users...
|
- name: MYSQL_USER | Manages users...
|
||||||
|
@ -74,5 +75,6 @@
|
||||||
host: "{{ item.host | default(omit) }}"
|
host: "{{ item.host | default(omit) }}"
|
||||||
host_all: "{{ item.host_all | default(omit) }}"
|
host_all: "{{ item.host_all | default(omit) }}"
|
||||||
state: present
|
state: present
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
loop: "{{ mariadb_users }}"
|
loop: "{{ mariadb_users }}"
|
||||||
no_log: "{{ not mariadb_debug_role }}"
|
no_log: "{{ not mariadb_debug_role }}"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
community.mysql.mysql_variables:
|
community.mysql.mysql_variables:
|
||||||
variable: read_only
|
variable: read_only
|
||||||
value: 'ON'
|
value: 'ON'
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
when: mariadb_slave_readonly
|
when: mariadb_slave_readonly
|
||||||
|
|
||||||
- name: TEMPLATE | Deploy slave configuration
|
- name: TEMPLATE | Deploy slave configuration
|
||||||
|
@ -18,6 +19,7 @@
|
||||||
- name: MYSQL_REPLICATION | Get slave status
|
- name: MYSQL_REPLICATION | Get slave status
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
mode: getslave
|
mode: getslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: slave_status
|
register: slave_status
|
||||||
|
|
||||||
|
@ -32,5 +34,6 @@
|
||||||
- name: MYSQL_REPLICATION | Get slave status
|
- name: MYSQL_REPLICATION | Get slave status
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
mode: getslave
|
mode: getslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: slave_status
|
register: slave_status
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
- name: MYSQL_REPLICATION | Stop slave
|
- name: MYSQL_REPLICATION | Stop slave
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
mode: stopslave
|
mode: stopslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Configure master host
|
- name: MYSQL_REPLICATION | Configure master host
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
|
@ -11,12 +12,15 @@
|
||||||
master_port: "{{ mariadb_replication_port }}"
|
master_port: "{{ mariadb_replication_port }}"
|
||||||
master_user: "{{ mariadb_replication_user }}"
|
master_user: "{{ mariadb_replication_user }}"
|
||||||
master_password: "{{ mariadb_replication_password }}"
|
master_password: "{{ mariadb_replication_password }}"
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
no_log: "{{ not mariadb_debug_role }}"
|
no_log: "{{ not mariadb_debug_role }}"
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Setup replication with GTID
|
- name: MYSQL_REPLICATION | Setup replication with GTID
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
primary_use_gtid: current_pos
|
primary_use_gtid: current_pos
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Start slave
|
- name: MYSQL_REPLICATION | Start slave
|
||||||
community.mysql.mysql_replication:
|
community.mysql.mysql_replication:
|
||||||
mode: startslave
|
mode: startslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
- name: MYSQL_VARIABLES | Get datadir
|
- name: MYSQL_VARIABLES | Get datadir
|
||||||
community.mysql.mysql_variables:
|
community.mysql.mysql_variables:
|
||||||
variable: datadir
|
variable: datadir
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
register: datadir
|
register: datadir
|
||||||
|
|
||||||
- name: SET_FACT | Get MariaDB datadir
|
- name: SET_FACT | Get MariaDB datadir
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
- name: MYSQL_REPLICATION | Stop slave
|
- name: MYSQL_REPLICATION | Stop slave
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: stopslave
|
mode: stopslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Configure master host
|
- name: MYSQL_REPLICATION | Configure master host
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
master_port: "{{ mariadb_replication_port }}"
|
master_port: "{{ mariadb_replication_port }}"
|
||||||
master_user: "{{ mariadb_replication_user }}"
|
master_user: "{{ mariadb_replication_user }}"
|
||||||
master_password: "{{ mariadb_replication_password }}"
|
master_password: "{{ mariadb_replication_password }}"
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
no_log: "{{ not mariadb_debug_role }}"
|
no_log: "{{ not mariadb_debug_role }}"
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Change master
|
- name: MYSQL_REPLICATION | Change master
|
||||||
|
@ -18,8 +20,10 @@
|
||||||
mode: changemaster
|
mode: changemaster
|
||||||
master_log_file: "{{ mariadb_master_log_file }}"
|
master_log_file: "{{ mariadb_master_log_file }}"
|
||||||
master_log_pos: "{{ mariadb_master_log_pos }}"
|
master_log_pos: "{{ mariadb_master_log_pos }}"
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
when: mariadb_master_log_file is defined and mariadb_master_log_pos is defined
|
when: mariadb_master_log_file is defined and mariadb_master_log_pos is defined
|
||||||
|
|
||||||
- name: MYSQL_REPLICATION | Start slave
|
- name: MYSQL_REPLICATION | Start slave
|
||||||
mysql_replication:
|
mysql_replication:
|
||||||
mode: startslave
|
mode: startslave
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
name: ''
|
name: ''
|
||||||
host: "{{ item }}"
|
host: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
loop:
|
loop:
|
||||||
- "{{ ansible_hostname }}"
|
- "{{ ansible_hostname }}"
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
|
@ -15,3 +16,4 @@
|
||||||
mysql_db:
|
mysql_db:
|
||||||
name: test
|
name: test
|
||||||
state: absent
|
state: absent
|
||||||
|
login_unix_socket: "{{ mariadb_socket }}"
|
||||||
|
|
Loading…
Reference in New Issue