mariadb: Migrate to use backup_base

This commit is contained in:
Timo Makinen 2024-06-22 19:25:04 +00:00
parent b692084f16
commit 849b4ab887
3 changed files with 6 additions and 22 deletions

View file

@ -13,7 +13,8 @@ find . -xdev -mindepth 2 -maxdepth 2 -type f -mtime +30 \
find . -xdev -depth -mindepth 1 -maxdepth 1 -type d -empty \
-execdir rmdir -- {} \;
mkdir "$DATE"
mkdir -m 2770 "$DATE"
chgrp backup "$DATE"
for db in $(mysql -e "show databases" -s) ; do
case "$db" in

View file

@ -0,0 +1,4 @@
---
dependencies:
- {role: backup_base}

View file

@ -96,27 +96,6 @@
group: "{{ ansible_wheel }}"
when: mariadb_root_password is defined
- name: Import sftpuser role
ansible.builtin.import_role:
name: sftpuser
- name: Create backup directory
ansible.builtin.file:
path: /export/backup
state: directory
mode: "02750"
owner: root
group: backup
- name: Link backup directory
ansible.builtin.file:
path: /srv/backup
src: /export/backup
state: link
owner: root
group: "{{ ansible_wheel }}"
follow: false
- name: Copy backup script
ansible.builtin.copy:
dest: /usr/local/sbin/mariadb-backup