system-config/playbooks/roles/gerrit/tasks/backup.yaml
Clark Boylan 75e0cf106a Remove the mysql support from our gerrit role and image
We are now using the mariadb jdbc connector in production and no longer
need to include the mysql legacy connector in our images. We also don't
need support for h2 or mysql as testing and prod are all using the
mariadb connector and local database.

Note this is a separate change to ensure everything is happy with the
mariadb connector before we remove the fallback mysql connector from our
images.

Change-Id: I982d3c3c026a5351bff567ce7fbb32798718ec1b
2021-08-10 13:06:54 -07:00

20 lines
827 B
YAML

- name: Create backup streaming config dir
file:
path: /etc/borg-streams
state: directory
# NOTE(ianw) 2021-06-09 : we don't also keep an on-disk backup as we
# did for the old mysql instance above because it's easy to restore
# from borg now (in the past with bup it was a real pain to extract
# data so it was worth managing on-disk copies to possibly avoid that).
#
# # borg-mount <backup-server>
# the dump file will be under
# /opt/backups/review02-mariadb-<date>T<time>/mariadb
- name: Create mariadb streaming file to setup mariadb backup jobs
copy:
content: >-
/usr/local/bin/docker-compose -f /etc/gerrit-compose/docker-compose.yaml exec -T mariadb
bash -c '/usr/bin/mysqldump --all-databases --single-transaction -uroot -p"$MYSQL_ROOT_PASSWORD"'
dest: /etc/borg-streams/mariadb