mirror of
https://github.com/HanXHX/ansible-mysql.git
synced 2026-02-24 10:13:30 +07:00
Better code display
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
---
|
||||
|
||||
- name: TEMPLATE | Deploy Galera configuration
|
||||
template: src=etc/mysql/conf.d/09-galera.cnf.j2 dest=/etc/mysql/conf.d/09-galera.cnf
|
||||
template:
|
||||
src: etc/mysql/conf.d/09-galera.cnf.j2
|
||||
dest: /etc/mysql/conf.d/09-galera.cnf
|
||||
register: galeraconfig
|
||||
|
||||
- name: INCLUDE | Bootstrap first node
|
||||
@@ -13,7 +15,9 @@
|
||||
when: inventory_hostname != mariadb_galera_primary_node
|
||||
|
||||
- name: SERVICE | Restart MariaDB if needed
|
||||
service: name=mysql state=restarted
|
||||
service:
|
||||
name: mysql
|
||||
state: restarted
|
||||
when: >
|
||||
((galeraconfig or (p is defined and p.changed)) and
|
||||
(bootstrap_run is not defined)) or
|
||||
|
||||
@@ -14,18 +14,22 @@
|
||||
- block:
|
||||
|
||||
- name: SERVICE | Stop MariaDB
|
||||
service: name=mysql state=stopped
|
||||
service:
|
||||
name: mysql
|
||||
state: stopped
|
||||
|
||||
- name: COPY | Paste primary node's debian.cnf
|
||||
copy: >
|
||||
content={{ debiancnf.stdout }}
|
||||
dest=/etc/mysql/debian.cnf
|
||||
mode=0600
|
||||
owner=root
|
||||
group=root
|
||||
copy:
|
||||
content: "{{ debiancnf.stdout }}"
|
||||
dest: /etc/mysql/debian.cnf
|
||||
mode: 0600
|
||||
owner: root
|
||||
group: root
|
||||
register: paste
|
||||
|
||||
- name: SERVICE | Start MariaDB
|
||||
service: name=mysql state=started
|
||||
service:
|
||||
name: mysql
|
||||
state: started
|
||||
|
||||
when: debiancnf.stdout != ondc.stdout
|
||||
|
||||
Reference in New Issue
Block a user