🐛 Fix unix login issue

pull/45/merge 2.2.1
Emilien Mantel 2022-03-04 10:56:27 +01:00
parent f7235d38b9
commit 239ce0dd6c
6 changed files with 16 additions and 0 deletions

View File

@ -64,6 +64,7 @@
community.mysql.mysql_db:
name: "{{ item }}"
state: present
login_unix_socket: "{{ mariadb_socket }}"
loop: "{{ mariadb_databases }}"
- name: MYSQL_USER | Manages users...
@ -74,5 +75,6 @@
host: "{{ item.host | default(omit) }}"
host_all: "{{ item.host_all | default(omit) }}"
state: present
login_unix_socket: "{{ mariadb_socket }}"
loop: "{{ mariadb_users }}"
no_log: "{{ not mariadb_debug_role }}"

View File

@ -4,6 +4,7 @@
community.mysql.mysql_variables:
variable: read_only
value: 'ON'
login_unix_socket: "{{ mariadb_socket }}"
when: mariadb_slave_readonly
- name: TEMPLATE | Deploy slave configuration
@ -18,6 +19,7 @@
- name: MYSQL_REPLICATION | Get slave status
community.mysql.mysql_replication:
mode: getslave
login_unix_socket: "{{ mariadb_socket }}"
ignore_errors: true
register: slave_status
@ -32,5 +34,6 @@
- name: MYSQL_REPLICATION | Get slave status
community.mysql.mysql_replication:
mode: getslave
login_unix_socket: "{{ mariadb_socket }}"
ignore_errors: true
register: slave_status

View File

@ -3,6 +3,7 @@
- name: MYSQL_REPLICATION | Stop slave
community.mysql.mysql_replication:
mode: stopslave
login_unix_socket: "{{ mariadb_socket }}"
- name: MYSQL_REPLICATION | Configure master host
community.mysql.mysql_replication:
@ -11,12 +12,15 @@
master_port: "{{ mariadb_replication_port }}"
master_user: "{{ mariadb_replication_user }}"
master_password: "{{ mariadb_replication_password }}"
login_unix_socket: "{{ mariadb_socket }}"
no_log: "{{ not mariadb_debug_role }}"
- name: MYSQL_REPLICATION | Setup replication with GTID
community.mysql.mysql_replication:
primary_use_gtid: current_pos
login_unix_socket: "{{ mariadb_socket }}"
- name: MYSQL_REPLICATION | Start slave
community.mysql.mysql_replication:
mode: startslave
login_unix_socket: "{{ mariadb_socket }}"

View File

@ -44,6 +44,7 @@
- name: MYSQL_VARIABLES | Get datadir
community.mysql.mysql_variables:
variable: datadir
login_unix_socket: "{{ mariadb_socket }}"
register: datadir
- name: SET_FACT | Get MariaDB datadir

View File

@ -3,6 +3,7 @@
- name: MYSQL_REPLICATION | Stop slave
mysql_replication:
mode: stopslave
login_unix_socket: "{{ mariadb_socket }}"
- name: MYSQL_REPLICATION | Configure master host
mysql_replication:
@ -11,6 +12,7 @@
master_port: "{{ mariadb_replication_port }}"
master_user: "{{ mariadb_replication_user }}"
master_password: "{{ mariadb_replication_password }}"
login_unix_socket: "{{ mariadb_socket }}"
no_log: "{{ not mariadb_debug_role }}"
- name: MYSQL_REPLICATION | Change master
@ -18,8 +20,10 @@
mode: changemaster
master_log_file: "{{ mariadb_master_log_file }}"
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
- name: MYSQL_REPLICATION | Start slave
mysql_replication:
mode: startslave
login_unix_socket: "{{ mariadb_socket }}"

View File

@ -5,6 +5,7 @@
name: ''
host: "{{ item }}"
state: absent
login_unix_socket: "{{ mariadb_socket }}"
loop:
- "{{ ansible_hostname }}"
- 127.0.0.1
@ -15,3 +16,4 @@
mysql_db:
name: test
state: absent
login_unix_socket: "{{ mariadb_socket }}"