2024-08-26 19:59:55 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
# Note: master must be converged first
|
|
|
|
- name: Converge master
|
|
|
|
hosts: master
|
|
|
|
gather_facts: true
|
|
|
|
tasks:
|
|
|
|
- name: Include role
|
|
|
|
ansible.builtin.include_role:
|
2024-10-21 22:45:11 +07:00
|
|
|
name: "hanxhx.mysql"
|
2024-08-26 19:59:55 +07:00
|
|
|
|
|
|
|
- name: COPY | Deploy first dump
|
|
|
|
ansible.builtin.copy:
|
2024-08-26 22:37:21 +07:00
|
|
|
src: ../_shared/files/import1.sql
|
2024-08-26 19:59:55 +07:00
|
|
|
dest: /tmp/import1.sql
|
|
|
|
mode: 0644
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
|
|
|
|
- name: MYSQL_DB | Import first dump
|
|
|
|
community.mysql.mysql_db:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: import
|
|
|
|
target: /tmp/import1.sql
|
|
|
|
login_unix_socket: "/run/mysqld/mysqld.sock"
|
|
|
|
loop: "{{ mariadb_databases }}"
|
2024-08-27 15:16:17 +07:00
|
|
|
tags:
|
|
|
|
- molecule-idempotence-notest
|
2024-08-26 19:59:55 +07:00
|
|
|
|
|
|
|
- name: Converge slave
|
|
|
|
hosts: slave
|
|
|
|
gather_facts: true
|
|
|
|
tasks:
|
|
|
|
- name: Include role
|
|
|
|
ansible.builtin.include_role:
|
2024-10-21 22:45:11 +07:00
|
|
|
name: "hanxhx.mysql"
|