refs #8414 - Rsync to dont´t fail at the end
This commit is contained in:
parent
994447329c
commit
d1ec1bc57b
|
@ -71,7 +71,7 @@
|
||||||
# mode: u=rw,g=r,o=r
|
# mode: u=rw,g=r,o=r
|
||||||
|
|
||||||
- name: Insert MySQL certificates
|
- name: Insert MySQL certificates
|
||||||
#no_log: true
|
no_log: true
|
||||||
copy:
|
copy:
|
||||||
content: "{{ item.content }}"
|
content: "{{ item.content }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
- /mnt/local-backup
|
- /mnt/local-backup
|
||||||
Make sure they are correctly configured and accessible.
|
Make sure they are correctly configured and accessible.
|
||||||
|
|
||||||
- when: production is false
|
- when: production is false or production is not defined
|
||||||
|
|
||||||
block:
|
block:
|
||||||
- name: Set MariaDB custom configuration Test-DB-DEV
|
- name: Set MariaDB custom configuration Test-DB-DEV
|
||||||
|
@ -157,3 +157,26 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: u=rw,g=,o=
|
mode: u=rw,g=,o=
|
||||||
|
|
||||||
|
- name: Check if /var/lib/mysql/ exists
|
||||||
|
stat:
|
||||||
|
path: /var/lib/mysql/
|
||||||
|
register: mysql_dir
|
||||||
|
|
||||||
|
|
||||||
|
- when: mysql_dir.stat.exists
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Sync MySQL data directory
|
||||||
|
synchronize:
|
||||||
|
src: /var/lib/mysql/
|
||||||
|
dest: /mnt/mysqldata/mysql/
|
||||||
|
archive: true
|
||||||
|
compress: true
|
||||||
|
recursive: true
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
|
|
||||||
|
- name: Remove old MySQL data after sync
|
||||||
|
file:
|
||||||
|
path: /var/lib/mysql/
|
||||||
|
state: absent
|
||||||
|
|
Loading…
Reference in New Issue