kolla-ansible/ansible/roles/mariadb/tasks/backup.yml
Michal Arbet 5d17100118 Additional small changes in role/mariadb
- Replace hardcoded haproxy monitor user with variable.
 - Rename mariadb_backup variable to mariadb_backup_possible.
 - Drop creation of monitor user in handlers as this is
   now handled in register.yml for good reason.

Change-Id: I255a79d36ae18ca42d0befd00b235ca509197db3
2021-04-14 16:10:30 +02:00

24 lines
817 B
YAML

---
- name: Taking {{ mariadb_backup_type }} database backup via Mariabackup
become: true
kolla_docker:
action: "start_container"
command: "bash -c 'sudo -E kolla_set_configs && /usr/local/bin/kolla_mariadb_backup.sh'"
common_options: "{{ docker_common_options }}"
detach: False
image: "{{ mariabackup_image_full }}"
name: "mariabackup"
restart_policy: no
remove_on_exit: True
environment:
BACKUP_TYPE: "{{ mariadb_backup_type }}"
volumes:
- "{{ node_config_directory }}/mariabackup/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "mariadb:/var/lib/mysql"
- "mariadb_backup:/backup"
- "kolla_logs:/var/log/kolla/"
when:
- inventory_hostname == mariadb_backup_host
- mariadb_backup_possible | bool