diff --git a/docs/backups.md b/docs/backups.md index d2f9e33a51f01c7b202cb99de53fbd495ef46eea..c9fc2b0d0de110ff4fa9eeb3b3a9d1170f35d27b 100644 --- a/docs/backups.md +++ b/docs/backups.md @@ -85,10 +85,6 @@ For PostgreSQL backups are made using pg_dump to `postgres_backup_dir`. Restoring backups can be done with `pg_restore`. See also [official PostgreSQL docs](https://www.postgresql.org/docs/current/app-pgrestore.html). -### Gitlab - -GitLab is backupped up using the `gitlab_backup` tool to `gitlab_backupdir`. See also [official GitLab docs](https://docs.gitlab.com/ee/raketasks/backup_restore.html). - ## Adding a new server Adding a new server to be backed up goes as follows: diff --git a/host_vars/gitlab.archlinux.org/misc b/host_vars/gitlab.archlinux.org/misc index 7ca302a958faaa39c39605e2ce57557045b9443c..a7e76c3f6a1dadedbb5209bed0a2041cfcbf6dc3 100644 --- a/host_vars/gitlab.archlinux.org/misc +++ b/host_vars/gitlab.archlinux.org/misc @@ -1,6 +1,5 @@ --- filesystem: btrfs -gitlab_backupdir: /srv/gitlab/data/backups additional_addresses: ["116.203.6.156/32", "2a01:4f8:c2c:5d2d::2/64"] wireguard_address: 10.0.0.5 wireguard_public_key: EbZisS0fwM6B8Nkugy1lyox+A8L13hniucVIPVCK5R0= diff --git a/roles/borg_client/tasks/main.yml b/roles/borg_client/tasks/main.yml index d8f3e933ed5b32b1525da6eec80688a29af45692..eea7fd0bcb3e0c2ca86e86fac2bf1496ac7a90d8 100644 --- a/roles/borg_client/tasks/main.yml +++ b/roles/borg_client/tasks/main.yml @@ -56,10 +56,6 @@ file: path={{ mysql_backup_dir }} state=directory owner=root group=root mode=0755 when: mysql_backup_dir is defined -- name: install gitlab backup script - template: src=backup-gitlab.sh.j2 dest=/usr/local/bin/backup-gitlab.sh owner=root group=root mode=0755 - when: inventory_hostname == "gitlab.archlinux.org" - - name: install systemd services for backup template: src={{ item }}.j2 dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644 with_items: diff --git a/roles/borg_client/templates/backup-gitlab.sh.j2 b/roles/borg_client/templates/backup-gitlab.sh.j2 deleted file mode 100644 index f6480ca79601bdce92df1865cfe99d4b18b92e45..0000000000000000000000000000000000000000 --- a/roles/borg_client/templates/backup-gitlab.sh.j2 +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Script to backup Gitlab running in a Docker container -# -# https://docs.gitlab.com/omnibus/settings/backups.html#creating-backups-for-gitlab-instances-in-docker-containers -# - -backupdir="{{ gitlab_backupdir }}" - -echo "emptying backup directory ${backupdir}" - -# Verify that the gitlab_backupdir in ansible was defined, otherwise we will rm /* and remove the previous backup -rm -r "${backupdir:?backup dir unset}/"* - -docker exec gitlab gitlab-backup create STRATEGY=copy SKIP=tar GZIP_RSYNCABLE=yes diff --git a/roles/borg_client/templates/borg-backup.service.j2 b/roles/borg_client/templates/borg-backup.service.j2 index bc26b541c57ef8f6f9fd25247b4dae7ec796efa1..219cefb33f6904d112eb767a234b7615b708c847 100644 --- a/roles/borg_client/templates/borg-backup.service.j2 +++ b/roles/borg_client/templates/borg-backup.service.j2 @@ -1,10 +1,6 @@ [Unit] Description=Borg backup -{% if inventory_hostname == "gitlab.archlinux.org" %} -# The ordering relation defined below is important for the GitLab backups -# because the offsite backup reuses the tarballs from this service's run. -{% endif %} Wants=borg-backup-offsite.service Before=borg-backup-offsite.service diff --git a/roles/borg_client/templates/borg-backup.sh.j2 b/roles/borg_client/templates/borg-backup.sh.j2 index 8b51328c87eba14c65f4a238623118a1e169c22f..16e2d86c48e94e852ec37d956f354e41742251c9 100644 --- a/roles/borg_client/templates/borg-backup.sh.j2 +++ b/roles/borg_client/templates/borg-backup.sh.j2 @@ -45,12 +45,6 @@ if systemctl is-active mysqld || systemctl is-active mariadb; then /usr/local/bin/backup-mysql.sh || true fi -{# When backing up to offsite, reuse the existing tarballs from the previous backup #} -{% if inventory_hostname == "gitlab.archlinux.org" and item['suffix'] != '-offsite' %} -# Create tarball backups of various GitLab directories using the official backup tool -systemctl is-active docker && /usr/local/bin/backup-gitlab.sh -{% endif %} - if is_btrfs "$src"; then # List all btrfs submounts we want to backup, e.g. homedir.archlinux.org with "/ /home" list_of_btrfs_submounts=$(findmnt -Rl -o target,fstype,options / | grep btrfs | grep -v docker | grep -v "subvol=\/[[:alnum:]]" | cut -d ' ' -f1) diff --git a/roles/gitlab/defaults/main.yml b/roles/gitlab/defaults/main.yml deleted file mode 100644 index 6d6097b1e59a977c43360dc5eda1e8f5f1b05cb7..0000000000000000000000000000000000000000 --- a/roles/gitlab/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ -gitlab_backupdir: /srv/gitlab/data/backups