kolla-ansible/ansible/roles/mariadb/tasks/backup.yml
Nick Jones f704a78029 Add new option to perform an on-demand backup of MariaDB
blueprint database-backup-recovery

Introduce a new option, mariadb_backup, which takes a backup of all
databases hosted in MariaDB.

Backups are performed using XtraBackup, the output of which is saved to
a dedicated Docker volume on the target host (which defaults to the
first node in the MariaDB cluster).

It supports either full (the default) or incremental backups.

Change-Id: Ied224c0d19b8734aa72092aaddd530155999dbc3
2018-11-22 09:20:59 +00:00

20 lines
596 B
YAML

---
- name: Taking {{ mariadb_backup_type }} database backup via XtraBackup
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ xtrabackup_image_full }}"
name: "xtrabackup"
restart_policy: "never"
remove_on_exit: True
environment:
BACKUP_TYPE: "{{ mariadb_backup_type }}"
volumes:
- "{{ node_config_directory }}xtrabackup:/etc/mysql:ro"
- "/etc/localtime:/etc/localtime:ro"
- "mariadb_backup:/backup"
volumes_from:
- "mariadb"
when:
- inventory_hostname == mariadb_backup_host