From 49a8cad3ef06c2afc0315bbe68e4c403eb463c41 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 9 Nov 2025 22:35:34 +0000 Subject: [PATCH 01/16] Add rule about AI contributions --- docs/docs/onboarding/rules.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs/onboarding/rules.md b/docs/docs/onboarding/rules.md index 961ca56a..4c21c17e 100644 --- a/docs/docs/onboarding/rules.md +++ b/docs/docs/onboarding/rules.md @@ -12,3 +12,4 @@ The rules any DevOps team member must follow. 5. Our software is never legacy, it's merely well-aged 6. Contributions made by AI tooling will be met with a Bengal Tiger, and it will be very, very hungry. 7. Ignore these rules (however maybe not 1, 1 seems important to remember) +8. Contributions made by AI tooling will be met with a Bengal Tiger, and it will be very, very hungry. From ce81c8119af8016e7739bb5834ef0d88d877468a Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 16 Nov 2025 21:37:41 +0000 Subject: [PATCH 02/16] Add preliminary borg role Co-authored-by: ChrisJL Co-authored-by: GDWR --- ansible/roles/borg/meta/main.yml | 3 + ansible/roles/borg/tasks/main.yml | 109 ++++++++++++++ ansible/roles/borg/templates/borgmatic.env.j2 | 3 + .../roles/borg/templates/borgmatic.service.j2 | 66 +++++++++ .../roles/borg/templates/borgmatic.timer.j2 | 9 ++ ansible/roles/borg/templates/config.yaml.j2 | 140 ++++++++++++++++++ ansible/roles/borg/vars/main/keys.yml | 11 ++ ansible/roles/borg/vars/main/main.yml | 20 +++ 8 files changed, 361 insertions(+) create mode 100644 ansible/roles/borg/meta/main.yml create mode 100644 ansible/roles/borg/tasks/main.yml create mode 100644 ansible/roles/borg/templates/borgmatic.env.j2 create mode 100644 ansible/roles/borg/templates/borgmatic.service.j2 create mode 100644 ansible/roles/borg/templates/borgmatic.timer.j2 create mode 100644 ansible/roles/borg/templates/config.yaml.j2 create mode 100644 ansible/roles/borg/vars/main/keys.yml create mode 100644 ansible/roles/borg/vars/main/main.yml diff --git a/ansible/roles/borg/meta/main.yml b/ansible/roles/borg/meta/main.yml new file mode 100644 index 00000000..56e9b539 --- /dev/null +++ b/ansible/roles/borg/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - systemd diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml new file mode 100644 index 00000000..856ae2bf --- /dev/null +++ b/ansible/roles/borg/tasks/main.yml @@ -0,0 +1,109 @@ +--- +- name: Install Borg Backup + package: + name: + - borgbackup2 + state: present + tags: + - role::borg + +- name: Create borg service user account + user: + state: present + system: true + name: "{{ borg_user }}" + home: "{{ borg_home }}" + shell: /usr/sbin/nologin + tags: + - role::borg + +- name: Create borgmatic virtual environment + command: + cmd: python3 -m venv {{ borg_virtualenv }} + creates: "{{ borg_virtualenv }}/bin/activate" + tags: + - role::borg + +- name: Install borgmatic into virtual environment + pip: + virtualenv: "{{ borg_virtualenv }}" + name: borgmatic + version: "{{ borg_version | default(omit) }}" + state: present + tags: + - role::borg + +- name: Template Borg environment variables + template: + src: borgmatic.env.j2 + dest: /etc/default/borgmatic + mode: "0444" + owner: root + group: root + tags: + - role::borg + +- name: Create borgmatic configuration directory + file: + state: directory + owner: borg + group: root + mode: "0755" + path: /etc/borgmatic + tags: + - role::borg + +- name: Template Borg configuration file + template: + src: config.yaml.j2 + dest: /etc/borgmatic/config.yaml + mode: "0444" + owner: borg + group: root + tags: + - role::borg + +- name: Create borgmatic service + template: + src: borgmatic.service.j2 + dest: /etc/systemd/system/borgmatic.service + owner: root + group: root + mode: "0444" + tags: + - role::borg + notify: + - Reload the systemd daemon + +- name: Create borgmatic timer + template: + src: borgmatic.timer.j2 + dest: /etc/systemd/system/borgmatic.timer + owner: root + group: root + mode: "0444" + tags: + - role::borg + notify: + - Reload the systemd daemon + +- name: Enable borgmatic timer + systemd: + name: borgmatic.timer + enabled: true + masked: false + tags: + - role::borg + notify: + - Reload the systemd daemon + +- name: Create borgmatic repositories + become_user: "{{ borg_user }}" + command: "{{ borg_virtualenv }}/bin/borgmatic repo-create --encryption=none" + environment: + POSTGRES_PASSWORD: "{{ vault_postgres_user_passwords.borg }}" + BORG_S3_KEY_ID: "{{ borg_s3_access_key_id }}" + BORG_S3_KEY_SECRET: "{{ borg_s3_access_key_secret }}" + # creates: "{{ borg_home }}/keys/repositories/borg2" + tags: + - role::borg diff --git a/ansible/roles/borg/templates/borgmatic.env.j2 b/ansible/roles/borg/templates/borgmatic.env.j2 new file mode 100644 index 00000000..05a6b085 --- /dev/null +++ b/ansible/roles/borg/templates/borgmatic.env.j2 @@ -0,0 +1,3 @@ +POSTGRES_PASSWORD="{{ vault_postgres_user_passwords.borg }}" +BORG_S3_KEY_ID="{{ borg_s3_access_key_id }}" +BORG_S3_KEY_SECRET="{{ borg_s3_access_key_secret }}" diff --git a/ansible/roles/borg/templates/borgmatic.service.j2 b/ansible/roles/borg/templates/borgmatic.service.j2 new file mode 100644 index 00000000..93b082df --- /dev/null +++ b/ansible/roles/borg/templates/borgmatic.service.j2 @@ -0,0 +1,66 @@ +[Unit] +Description=borgmatic backup +Wants=network-online.target +After=network-online.target +Documentation=https://torsion.org/borgmatic/ + +[Service] +User={{ borg_user }} +EnvironmentFile=/etc/default/borgmatic +Type=oneshot +RuntimeDirectory=borgmatic +StateDirectory=borgmatic + +# Security settings for systemd running as root, optional but recommended to improve security. You +# can disable individual settings if they cause problems for your use case. For more details, see +# the systemd manual: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +LockPersonality=true +# Certain borgmatic features like Healthchecks integration need MemoryDenyWriteExecute to be off. +# But you can try setting it to "yes" for improved security if you don't use those features. +MemoryDenyWriteExecute=no +NoNewPrivileges=yes +# Filesystem hooks like ZFS may not work unless PrivateDevices is disabled. +PrivateDevices=yes +PrivateTmp=yes +ProtectClock=yes +ProtectControlGroups=yes +ProtectHostname=yes +ProtectKernelLogs=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK +RestrictNamespaces=yes +RestrictRealtime=yes +RestrictSUIDSGID=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service @mount +SystemCallErrorNumber=EPERM +# To restrict write access further, change "ProtectSystem" to "strict" and +# uncomment "ReadWritePaths", "TemporaryFileSystem", "BindPaths" and +# "BindReadOnlyPaths". Then add any local repository paths to the list of +# "ReadWritePaths". This leaves most of the filesystem read-only to borgmatic. +ProtectSystem=full +# ReadWritePaths=-/mnt/my_backup_drive +# This will mount a tmpfs on top of /root and pass through needed paths +# TemporaryFileSystem=/root:ro +# BindPaths=-/root/.cache/borg -/root/.config/borg -/root/.borgmatic +# BindReadOnlyPaths=-/root/.ssh + +# May interfere with running external programs within borgmatic hooks. This +# includes, for instance, programs to snapshot filesystems (e.g. ZFS). +CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAW + +# Lower CPU and I/O priority. +Nice=19 +CPUSchedulingPolicy=batch +IOSchedulingClass=best-effort +IOSchedulingPriority=7 +IOWeight=100 + +Restart=no +# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that +# doesn't support this (pre-240 or so), you may have to remove this option. +LogRateLimitIntervalSec=0 + +ExecStartPre={{ borg_virtualenv }}/bin/borgmatic config validate +ExecStart={{ borg_virtualenv }}/bin/borgmatic --config /etc/borgmatic/config.yaml diff --git a/ansible/roles/borg/templates/borgmatic.timer.j2 b/ansible/roles/borg/templates/borgmatic.timer.j2 new file mode 100644 index 00000000..63ef7ea0 --- /dev/null +++ b/ansible/roles/borg/templates/borgmatic.timer.j2 @@ -0,0 +1,9 @@ +[Unit] +Description=Run borgmatic backup + +[Timer] +OnCalendar={{ borg_timer }} +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/ansible/roles/borg/templates/config.yaml.j2 b/ansible/roles/borg/templates/config.yaml.j2 new file mode 100644 index 00000000..d9e79308 --- /dev/null +++ b/ansible/roles/borg/templates/config.yaml.j2 @@ -0,0 +1,140 @@ +repositories: + - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://eu-central-1.linodeobjects.com/borg/backups + label: frankfurt + - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://us-east-1.linodeobjects.com/borg/backups + label: newark + - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://ap-south-1.linodeobjects.com/borg/backups + label: singapore + +# Path for storing temporary runtime data like streaming database +# dumps and bootstrap metadata. borgmatic automatically creates and +# uses a "borgmatic" subdirectory here. Defaults to $XDG_RUNTIME_DIR +# or or $TMPDIR or $TEMP or /run/user/$UID. +# user_runtime_directory: /run/user/1001 + +retries: {{ borg_borgmatic_retries }} +retry_wait: {{ borg_borgmatic_retry_wait }} + +working_directory: {{ borg_home }} + +temporary_directory: /tmp +borg_base_directory: /etc/borgmatic +borg_config_directory: /etc/borgmatic/config +borg_cache_directory: {{ borg_home }}/cache +borg_security_directory: {{ borg_home }}/security +borg_keys_directory: {{ borg_home }}/keys + +archive_name_format: '{hostname}-databases-{now}' + +keep_daily: {{ borg_borgmatic_keep_daily }} + +read_special: true + +local_path: borg2 + +# List of one or more shell commands or scripts to execute after +# creating a backup, run once per repository. +# after_backup: + # - echo Finished a backup. + +# List of one or more shell commands or scripts to execute when an +# exception occurs during a "create", "prune", "compact", or "check" +# action or an associated before/after hook. +# on_error: + # - echo Error during create/prune/compact/check. + +# List of one or more shell commands or scripts to execute after +# running all actions (if one of them is "create"). These are +# collected from all configuration files and then run once after all +# of them (after any action). +# after_everything: + # - echo Completed actions. + + +postgresql_databases: + # Database name (required if using this hook). Or "all" to + # dump all databases on the host. (Also set the "format" + # to dump each database to a separate file instead of one + # combined file.) Note that using this database hook + # implicitly enables read_special (see above) to support + # dump and restore streaming. + - name: all + username: borg + password: ${POSTGRES_PASSWORD} + format: custom + # Disabled since Borg has built-in compression + compression: none + + # SSL mode to use to connect to the database server. One + # of "disable", "allow", "prefer", "require", "verify-ca" + # or "verify-full". Defaults to "disable". + # ssl_mode: require + + # Path to a client certificate. + # ssl_cert: /root/.postgresql/postgresql.crt + + # Path to a private client key. + # ssl_key: /root/.postgresql/postgresql.key + + # Path to a root certificate containing a list of trusted + # certificate authorities. + # ssl_root_cert: /root/.postgresql/root.crt + + # Path to a certificate revocation list. + # ssl_crl: /root/.postgresql/root.crl + + +# mongodb_databases: + # - name: all + # hostname: database.example.org + + # Username with which to connect to the database. Skip it + # if no authentication is needed. Supports the + # "{credential ...}" syntax. + # username: dbuser + + # Password with which to connect to the database. Skip it + # if no authentication is needed. Supports the + # "{credential ...}" syntax. + # password: trustsome1 + + +# Configuration for a monitoring integration with Grafana Loki. You +# can send the logs to a self-hosted instance or create an account at +# https://grafana.com/auth/sign-up/create-user. See borgmatic +# monitoring documentation for details. +# loki: + # Grafana loki log URL to notify when a backup begins, + # ends, or fails. + # url: http://localhost:3100/loki/api/v1/push + + # Allows setting custom labels for the logging stream. At + # least one label is required. "__hostname" gets replaced by + # the machine hostname automatically. "__config" gets replaced + # by the name of the configuration file. "__config_path" gets + # replaced by the full path of the configuration file. + # labels: + # app: borgmatic + # config: __config + # hostname: __hostname + +# Configuration for a monitoring integration with Sentry. You can use +# a self-hosted instance via https://develop.sentry.dev/self-hosted/ +# or create a cloud-hosted account at https://sentry.io. See borgmatic +# monitoring documentation for details. +# sentry: + # Sentry Data Source Name (DSN) URL, associated with a + # particular Sentry project. Used to construct a cron URL, + # notified when a backup begins, ends, or errors. + # data_source_name_url: https://5f80ec@o294220.ingest.us.sentry.io/203069 + + # Sentry monitor slug, associated with a particular Sentry + # project monitor. Used along with the data source name URL to + # construct a cron URL. + # monitor_slug: mymonitor + + # List of one or more monitoring states to ping for: "start", + # "finish", and/or "fail". Defaults to pinging for all states. + # states: + # - start + # - finish diff --git a/ansible/roles/borg/vars/main/keys.yml b/ansible/roles/borg/vars/main/keys.yml new file mode 100644 index 00000000..64a21bca --- /dev/null +++ b/ansible/roles/borg/vars/main/keys.yml @@ -0,0 +1,11 @@ +$ANSIBLE_VAULT;1.1;AES256 +34326663643266306162376261383566646364376639613137646237313636303430363739646631 +3762303366303532386362356135313462613639323330630a333937623737366231656264623065 +66643731373537326437383465386139373539653030343930646434313262386565323637356539 +3962383331353331310a363163383538636133623137633930393632653930643664306663366363 +62613233383935633533343861343864363131313435383237333738343766306565353463653337 +35336632646538373539333563393433336532393137633062353265636533666134346464383961 +33323562643462646436366133333566653565613537326137393164306165386166633539383663 +38616462386432623531653564623032626632353561656431336634373530633038626665633230 +33636639643037366332613264356463633262653663393531643932636335353163396431393465 +3162666530626433313865656164613434626334353465333738 diff --git a/ansible/roles/borg/vars/main/main.yml b/ansible/roles/borg/vars/main/main.yml new file mode 100644 index 00000000..f08c5283 --- /dev/null +++ b/ansible/roles/borg/vars/main/main.yml @@ -0,0 +1,20 @@ +--- +borg_user: borg +borg_home: /var/lib/borg +borg_virtualenv: "{{ borg_home }}/borgmatic-venv" + +borg_version: "2.0.11" + +# see https://wiki.archlinux.org/title/Systemd/Timers +# or for more details https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html +borg_timer: "*-*-* 09:00:00" + + +# Borgmatic config, see https://torsion.org/borgmatic/reference/configuration/ +borg_borgmatic_retries: "1" +borg_borgmatic_retry_wait: "3" +borg_borgmatic_keep_daily: "7" + + +borg_s3_access_key_id: "{{ vault_borg_s3_access_key_id }}" +borg_s3_access_key_secret: "{{ vault_borg_s3_access_key_secret }}" From 838d7db3e079690e2c1d9705a4ac49fe660157bb Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 16 Nov 2025 21:38:01 +0000 Subject: [PATCH 03/16] Run borg role on database hosts --- ansible/playbook.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 30979072..e898f9e3 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -65,6 +65,7 @@ - postgres - prometheus-postgres-exporter - mongodb + - borg - name: Deploy our LDAP server environment to the LDAP host hosts: ldap From bd9c96285750a186839c5cd8941b89c56c7cbac4 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 17 Nov 2025 01:39:10 +0000 Subject: [PATCH 04/16] Install borgbackup from source for S3 functionality --- ansible/roles/borg/tasks/main.yml | 17 ++++++++++++----- ansible/roles/borg/vars/main/main.yml | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml index 856ae2bf..1a3a0fbd 100644 --- a/ansible/roles/borg/tasks/main.yml +++ b/ansible/roles/borg/tasks/main.yml @@ -1,8 +1,14 @@ --- -- name: Install Borg Backup +- name: Install borg dependencies package: name: - - borgbackup2 + - liblz4-dev + - liblz4-1 + - libzstd-dev + - libzstd1 + - libacl1-dev + - libacl1 + - libxxhash0 state: present tags: - role::borg @@ -24,11 +30,12 @@ tags: - role::borg -- name: Install borgmatic into virtual environment +- name: Install borg & dependencies to virtual environment pip: virtualenv: "{{ borg_virtualenv }}" - name: borgmatic - version: "{{ borg_version | default(omit) }}" + name: + - borgbackup[s3] @ git+https://github.com/borgbackup/borg.git@{{ borg_git_version }} + - borgmatic=={{ borgmatic_version }} state: present tags: - role::borg diff --git a/ansible/roles/borg/vars/main/main.yml b/ansible/roles/borg/vars/main/main.yml index f08c5283..558fb73f 100644 --- a/ansible/roles/borg/vars/main/main.yml +++ b/ansible/roles/borg/vars/main/main.yml @@ -3,7 +3,9 @@ borg_user: borg borg_home: /var/lib/borg borg_virtualenv: "{{ borg_home }}/borgmatic-venv" -borg_version: "2.0.11" +# Pinned to a specific commit for S3 compatibility. +borg_git_version: "1373b30ba8e6b88f6264dc57f6a8da46d8b2e80f" +borgmatic_version: "2.0.11" # see https://wiki.archlinux.org/title/Systemd/Timers # or for more details https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html From e5767d049836e2a45b3e9eddb262ab6fb9331c47 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 17 Nov 2025 01:39:24 +0000 Subject: [PATCH 05/16] Use virtualenv version of borg --- ansible/roles/borg/templates/config.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/borg/templates/config.yaml.j2 b/ansible/roles/borg/templates/config.yaml.j2 index d9e79308..3bcba341 100644 --- a/ansible/roles/borg/templates/config.yaml.j2 +++ b/ansible/roles/borg/templates/config.yaml.j2 @@ -30,7 +30,7 @@ keep_daily: {{ borg_borgmatic_keep_daily }} read_special: true -local_path: borg2 +local_path: {{ borg_virtualenv }}/bin/borg # List of one or more shell commands or scripts to execute after # creating a backup, run once per repository. From 2b33645671763d25d5cff384a1d46dfdeef7caf8 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 17 Nov 2025 01:39:39 +0000 Subject: [PATCH 06/16] Update S3 paths to compatible URLs --- ansible/roles/borg/templates/config.yaml.j2 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ansible/roles/borg/templates/config.yaml.j2 b/ansible/roles/borg/templates/config.yaml.j2 index 3bcba341..482bb424 100644 --- a/ansible/roles/borg/templates/config.yaml.j2 +++ b/ansible/roles/borg/templates/config.yaml.j2 @@ -1,10 +1,8 @@ repositories: - - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://eu-central-1.linodeobjects.com/borg/backups + - path: b2:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://eu-central-1.linodeobjects.com/borg/database-backups/ label: frankfurt - - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://us-east-1.linodeobjects.com/borg/backups + - path: b2:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://us-east-1.linodeobjects.com/borg/database-backups/ label: newark - - path: s3:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://ap-south-1.linodeobjects.com/borg/backups - label: singapore # Path for storing temporary runtime data like streaming database # dumps and bootstrap metadata. borgmatic automatically creates and From 66a18cf83758dc8c92d2983c8cd269d24ed3e3fb Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 17 Nov 2025 01:55:49 +0000 Subject: [PATCH 07/16] Ensure the borgmatic timer is started --- ansible/roles/borg/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml index 1a3a0fbd..d8fc25f6 100644 --- a/ansible/roles/borg/tasks/main.yml +++ b/ansible/roles/borg/tasks/main.yml @@ -97,6 +97,7 @@ - name: Enable borgmatic timer systemd: name: borgmatic.timer + state: started enabled: true masked: false tags: From 7abb11bd82f5dd51f45e084eca0dad4e92859e41 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 24 May 2026 16:43:08 +0100 Subject: [PATCH 08/16] Change borgmatic environment file permissions to 0400 --- ansible/roles/borg/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml index d8fc25f6..6c76056b 100644 --- a/ansible/roles/borg/tasks/main.yml +++ b/ansible/roles/borg/tasks/main.yml @@ -44,7 +44,7 @@ template: src: borgmatic.env.j2 dest: /etc/default/borgmatic - mode: "0444" + mode: "0400" owner: root group: root tags: From 0c755ec0c1f519b30ad6ca0e3003424102aa3f22 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 24 May 2026 16:43:15 +0100 Subject: [PATCH 09/16] Add XDG_RUNTIME_DIR environment variable to borgmatic service --- ansible/roles/borg/templates/borgmatic.service.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/borg/templates/borgmatic.service.j2 b/ansible/roles/borg/templates/borgmatic.service.j2 index 93b082df..bfa677d2 100644 --- a/ansible/roles/borg/templates/borgmatic.service.j2 +++ b/ansible/roles/borg/templates/borgmatic.service.j2 @@ -7,6 +7,7 @@ Documentation=https://torsion.org/borgmatic/ [Service] User={{ borg_user }} EnvironmentFile=/etc/default/borgmatic +Environment=XDG_RUNTIME_DIR=/run Type=oneshot RuntimeDirectory=borgmatic StateDirectory=borgmatic From 1cc16f2a4c001fb8b38292164b46229cb19b42a2 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 24 May 2026 16:43:46 +0100 Subject: [PATCH 10/16] Add verbosity setting to borgmatic --- ansible/roles/borg/templates/config.yaml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/borg/templates/config.yaml.j2 b/ansible/roles/borg/templates/config.yaml.j2 index 482bb424..fb3f7e02 100644 --- a/ansible/roles/borg/templates/config.yaml.j2 +++ b/ansible/roles/borg/templates/config.yaml.j2 @@ -1,3 +1,5 @@ +verbosity: 1 + repositories: - path: b2:${BORG_S3_KEY_ID}:${BORG_S3_KEY_SECRET}@https://eu-central-1.linodeobjects.com/borg/database-backups/ label: frankfurt From bc35fbbc72341a3ac88ce4fff9c8727c22f967c6 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 24 May 2026 16:52:52 +0100 Subject: [PATCH 11/16] Add HBA rule for borg user --- ansible/roles/postgres/vars/main/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/roles/postgres/vars/main/main.yml b/ansible/roles/postgres/vars/main/main.yml index d91a3906..20d1c11c 100644 --- a/ansible/roles/postgres/vars/main/main.yml +++ b/ansible/roles/postgres/vars/main/main.yml @@ -160,6 +160,12 @@ postgres_hba_rules: address: all method: scram-sha-256 + - conn_type: hostssl + database: all + user: borg + address: all + method: scram-sha-256 + # # Analytics HBA rules # From ce26bcc79d3eebed716a886d55612949f1ec3da3 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 22 Aug 2026 21:11:18 +0100 Subject: [PATCH 12/16] Update Borg password in vault --- .../roles/postgres/vars/main/db_passwords.yml | 390 +++++++++--------- 1 file changed, 197 insertions(+), 193 deletions(-) diff --git a/ansible/roles/postgres/vars/main/db_passwords.yml b/ansible/roles/postgres/vars/main/db_passwords.yml index bc487e96..324093a4 100644 --- a/ansible/roles/postgres/vars/main/db_passwords.yml +++ b/ansible/roles/postgres/vars/main/db_passwords.yml @@ -1,194 +1,198 @@ $ANSIBLE_VAULT;1.1;AES256 -66383863303230333230633939316236306338623034396463636531623436363436313439326262 -3866393733616538326631613539346239366163613237640a323030626235623331313462306531 -39366132386632393966653731626438633336346635653162386638663135343965376464656335 -3239323661376465650a653230363635386234353764326265626664643935613361323539383534 -38663866313335626135323161366366626436373932633430316230353934646537333164666236 -66363733393061306438653033633731663862396532336632626234623631383566383732303865 -39393763363530306436396433653137386562353665646539613335613265636430356530373538 -34373666626633346565353338316437353035663263306661383736623262306161343632343232 -63613161653865306463616662313932346632343634633330663761353033316564373538303030 -62373535396432373238643861343862393865653762653637363838626565636564393139333233 -30356230303131613633343834623833653066336234386232363530646261313263373034336539 -61323534396362323639633661616233653263383065396466346130323561346234383262636463 -35333362343966336361306337313264616539356665383335656662396165326432636163373137 -63346439346466336364303139316337633830613639646363636465623736323461316231643666 -37366565636565633964313133386132376263313461613465643738356234383536626666343030 -63393361656563646238633338373465366339313734646664316333346434333535356165393062 -38626562316431393963313862313930306332333539626566633661666337396662663630396464 -33313232656566393939323466633462333536313930326463373931373238623233303761643962 -31663565323934336434376637343838383434323837386537323264363063656361643237393032 -33323665656132363266626132313035326430306136306563336336396138656161363663663065 -64373532353831353162643038393139616562633765386431306539326530353361383038633266 -37613839313135383934393938616466353666376230613235663138653865356238643866306361 -37343564363332343530386564303934396530663364306633656562656536333537366432613335 -62393133366466666139333238653933306439323966643366646631613566616433393133313835 -37666464396131666665663731666530663237363261626436636166396361663565356432346539 -66626162353830616338656361383331363964313261336630623666383936366530623033653639 -38616566646133353134653264643834383263383537323732386561343737633131646332343464 -39643037633831363963353235316266666536363932323863323230636664303666303262616136 -38313234366134336633363435636435613438316536366330353339613830353266623935616232 -38363063656235373762383130376132373661383032623031376636616662616331663036643138 -38663664633633663864336466636231303131613564353835633661613239386633356139656530 -33393236393432316665666430366561316338643061303638353765373231313337393230376462 -35616634396436326664633336323364383461613834356133303537346562313836343638616135 -66666237656438616530633361626366656566643566386563356530316237666633353062613638 -36656130646436666466353739616162363365623232623032303831636565333439363835336237 -62373463326466616436623131393664663530613630633866626362383564616463386333333530 -63636530363165326637316339613132666266363635353164386438346362353530646632373862 -36383766343338383835666234643133313436393334633938653763653930356132316336616336 -66633837313062373762373633626230646536633632646365616436393532343964643733303161 -63373464386532623837623731343961653161386237613163616537366561303831383935646638 -33616530643761383661336462393031323838373434383463336636393637386631376331326136 -38666638313863633165356666626465326532363038613861363135623863366630643766353463 -30666165666433353830663161323936383138343437323634383262643861323863653030346162 -38666638653461353763303963393833356562653235323462663532303166396330313136633939 -66346437373363353238323962386131613832633136313133343831336439323935303665323562 -31303234303233626566313864356633306139333464373965646439323366326235643730396562 -36393433353935666432386161363737336432326464346233663466353264626535323637343566 -63666331333632663633373862663635343736643363653139336130666664373534303636333435 -37316635386530666238663865616237633562313638353930626339636533656231616331376135 -64656266633064306435633862663766616433646362303264326132666536633632323761396636 -39356562343939656430646636613362323833386361663862343764343632666663303961633539 -61353132633961363936386562373231393633333165633866393861346539633465376666356664 -38386562356131306464323762316664383232663830643961353432656561656632323235646436 -37613532396566323532333864316161366139646663323162373535343831663632376530646535 -61323935306563373863656630386233343061356662333530666564663339363937366231396239 -37633136303638653765383565313665643137613865643439383966616266313834333562363464 -39303233623561303933353933336533663766393034313735326138326663373339313665333332 -66383461333938393531313338663933353664323632336566346664356336303834623761666339 -37303037643936326265373736326533346266383237313665346132393835393635626334313338 -65366637313739376364363763313637346665656363326439343736653635636235636433643266 -35353238613861383433636361386638333738323534663134393462393539653136623062316633 -65646236663538373739383361376339373465643038326133613964323963393762633134623930 -36626665633961396238326634353736613665343539373739306138633633313438366633333838 -63633466656465316164663932323138333035653733306639623733343864353166636264396534 -39643839343730363930313937303362383238303430333835313331623532313337613733653130 -61366162626439343036663833356362343362396361316662306538336636623366303664363938 -36616138633738643436356532376531666661393939663566633831313032343936633962613837 -33333839636438376662393062386631323336636234316132636437393161613138346335323332 -37343462366433323630326461316263306433323139303732363162646564653166613462353366 -30623432633361663736613064656437313534653237666565646137393935323436646564303930 -33316438343539386438316232313663306437393639396530363463636232373430623938636339 -35386566303862383933373733326636363338626635643666663631383066616130616466336161 -39613830336661333036643331386463396135376638613739366439633965353037323832663235 -37643235363031383631353662646633633837356266646633643361633662383465373532616533 -35626366363563663139653936353439373461343333363165363139313163643864323837643564 -63323761326638613934663636656437303261343939653034386638656338633731383563363264 -66623136386331326564373934653665383736316663396533363034386537613737346162613561 -61616364393332353736663266353335323434343634336566643430643634313764653038633232 -37646437326133623037666664663463653237663138636137326537613037396536383465633065 -62363932386539363664353631396461623033353132333131656663373863333161313739343536 -36663661623938333836386433376233653264353061633964336237623733366232613364383866 -31626632323336306266323534616135353738633364306534623533353164663763333039343230 -66383030636237383033626437653832626339623061616539393962656431633566396134623535 -61656138633562343264333830623339353761626466626561383766363135626165636464303738 -66636465626232646631373465316438323335643761303166653564303931373738333436646430 -36363130356439643662313937653762396161643431663030326463393432643330386631376130 -32346563393336313636626561333933373938616632373239343166393638636661366335663730 -33396630623662356566636333333439666433653134366431636663306365613233633463316363 -31663030353462313163623233643033636530333264323536346262636363313030313061336566 -38616666393466633932396163326564323633363532366263343335373364366362653839663866 -38353438393037653533343366643037396238373365626162646331346263633435613064653638 -66323232656664366631353435653638363663666233316532323862336364313236636530376636 -36353061663035616163323064363236653735643637386162366134343732373536343933333036 -34396430336261386539323932613466666333643237333363376635323033656161383063353837 -30636331383832366631616663303662346362326565303636666135333637653666373634646537 -30393064303066336535363738363234393764343963396539343936656532366565386636306330 -37653439353836366366376563666365636664306638656262343339376364363137343536333534 -36646135353666646236346133303535393635346462613734333332373163363664366663333737 -31346533303663353535653866316633333161353361636632636531356431663134313161376466 -33666432643437303934353638386636383161643165393965313539613030373531363233636164 -66653839333332373662663431383030393130633961313230633165333238393731633430623239 -35356533373937653430316531316137353765626162376565346430353562623964653736343363 -32373761376462396638383834316530666330383034663031636464663163643661306161636563 -64363062313731633230303265363462323033616339396263333261663937633336366636623333 -64393866396161376539343633623633393731623339333063643064646462646137613062623236 -34636465393431333038643566626230656230323536303666646638303565383236373331393932 -64653964643261363330313535363437376431643835316265633061616366346265323232396133 -36653332373261303230323235653831643961643762333730326437646139386464343237383366 -61393666633737663761376435353864366539663166643239366563656235316231386231323064 -34626363333930353532393931366334313665363165313934396435366666353433396335643737 -39343763373231623638343939303038333363313934636661616533393733383765366232353837 -62396563386338323536376166376661636234313966363431653630336432343265643939323964 -35653661373437323437346262393766323865626137613739643930666366656334323039303465 -36623333366266386263366464313363383534643035326439633931353763396134376632653437 -62313864626632613036376438316238623463623439303831313837386437646337333637666361 -33376639363634666638313537656131353831363331316335346538643766386361373861343039 -39333939333166336536393361356535623964643230626663363431393663623130393935363661 -65326562643966646464636638616439373030653461323365643861633830303431353837626562 -36313333623735666437313933663036643564343665346336346164343062343166356535373932 -61333432343130386164613230363536656166633431616235643133356161383264346263346134 -64663032363032383062316430616439393137636339663662306465383263663730353232643332 -63373730366137643736643834653361336665616664353736343039373862313762386361623433 -33643564623439373131623263353963646563303833613636643438616536343436663030323332 -31636338343336653938303130643562646433643137636133376365363638616530363563613966 -36343630643834346663313364363161613038356539613265313834353832656331356662656461 -65623362326638616264636537323331616339613831656132346536636533623038323264643365 -38326132636132313535303734613866323565373737326164383635623438646465363533366134 -34336266343763303030313962386438373531373666663931643039336636396332656662623563 -31366663393634353636396139373062323930396637333130366530376530373066653530396336 -34366537633561386262383235393235366664663864653865353030376466376135306639373764 -39613366383463613331663931373862663263353666316136616537333231393161396461376466 -61346633626536656538333734636233643334613037376132633661326264623334633463633238 -32313932386163376562366334643931646633646362653962343463316133356639306232616136 -61333834363334626461666161356131386530386438643162316465613361326266623561643133 -38383562663339303038363936666234353863396632303435623634353737343262613436393164 -61383938383835626162323664613836333366613261626638313163663338353137633165663763 -39366264646565613466313634343834373234393764356466613735363963303836306462633737 -35626365636533336633343663613363623833313764366238333134326231353336373030653263 -37396365636431383731303963653264623038383265326566636562393764653063356164396131 -66666637373232396537303131386262303164343531643761343134623437343339633564383566 -66643331393662663239373162663962613161656631346431363137666130653866616563666130 -37396361313830303134643037653762323136613939316233643562643539356635633636366236 -66396431313037303565343361653037383864626562373832623632306561633433346366646438 -64363765626134633537323866386332626331313934663738333233356266303863643039656332 -63633866396535333538333165366132333764336333636462336539386634376439616638656436 -32303138636435373235303830343363373836663866316634366537653637313732356639356432 -34626330663030353462666333656331393839333437643636306238646536393537373531303766 -33313432303262613361613439636665323836343833326136346465623236353134393965636231 -62383131366130323536306432633564623761336661363639623530343739376432643833616262 -39396630323230643262313764636461616461306330396561366662326638353833313730343066 -39396263363537633530376562616433306565633439636539663064616664313361636564656530 -39656432373831303832633833336364326136303539356536656639623134333935333733316536 -36353834363837323338383966633539366134656266363736366263336430373363366338323064 -61646534653531366235663866616135313665636136396439653431373137393036616139393530 -32393266336536636636396234373731633532353033323163323236623034626433316266326338 -33656334623730623962346131616630353562366462336366323237373630656564323161396261 -34373832386232313338633230313638313837343461376333613532336566636563623665303061 -39366264633835333034386161613363303265326539306238353062613766396539666461653537 -65353062303361303365396363306636363538316137363338343233383834626237653639333837 -63643637363465663863316465386263663161373662316534303334386336373732383064313536 -33356665623635356332323631613339356165316438363534356561623661616235306435353537 -31323937663537303438393662343238396461613063653764326264666464643936303366623261 -65623563316433383562363932383532633265353333353939313630306162386539383661313065 -38663064663063323230363762323561643038653839666235363266313132623134643533373235 -36633062306539346166356638313937613165313966656162376631396139653831363134306338 -62376233633533646238376235323061303736343336373965636334323565663630666462646262 -33663061613962616364363933323331623164373932613766626233393366326164396231396336 -36306539303735646335303764363864613634303636303932343932396338623639353363653263 -65363235373339306363383836366261393263393336393135383965646465386361666161643238 -30383035623564303261623134633562393562303031393033366166633437326532363136356462 -65323333313039356664373430343134353237636434376438613166396237626335613963663562 -66643835653863633236316265366235626633616635353839316231333231313463393534363632 -34306434366532383938386564393439326332383961306439373833323834393238303938623234 -64373430393731376438393539613164363164643761666363656462613238303466633561323837 -37343863396632363836343962303034363164363466346364376334666164643435333566333037 -65306639383431336439646265393936643162316630353430643334346239346161616532643636 -63666338306336343863653066623534326236383437373965663663353136653531336564613139 -34323333333164613535363164323064363937303830356632356236656436636437633565396662 -34623764653234643334346166353837623865346535333233323065393033383365663435363838 -38666238393432363039343238663035613730326630633439346461393035623665363339343661 -38393263363437386363633335343235373539666138303836613238343666353831393131333134 -61373465626463383933633965386534643466326436383462663761653663666464656464653161 -64373663633431666236316536643832353561303562363839336662386136316632653865323563 -33353266613362313866353739643765363639616639323434333533366261613963636233313861 -37306635356438666335313665626664376536373138366564316636663064396533656535346231 -37373262616633653737303164643365643562636638353064336565396139376134343761353031 -32663039343036393936623462653265343862326635303133663437363030346161323433393637 -65316662626566373233386465643361643566383332663465393230336665646238656364346161 -31306562386531353465613761386435363761653439343163353636326431656534646534306562 -61636537303261383662353532376231636364396564306632616337333564383666336332303630 -66666138653837323538663936396635333637623838633939313464623531326266366562303465 -61626136386465653638656637346261333034333366343032656634643339653363626166393630 -35313935653534336563643434623433616531653231646236656363366262323135 +37373732323463623630666336653638383333616132663436363937643562383831623831646665 +6232363435306663356537383166346662366230326261350a363034623033633864376163376136 +34383239633465336134333832346330336336626636326331303430616266663836366336356166 +3361373239366637660a393736393533646439666666313666323132386664366330323637323365 +30343464396462636363623161643132363636643861323263363232633938303437636135393636 +38323532653465303466666163313164653432643337396334306562633231343237353537613139 +65633463363362343661366365316237346130656165633236653334613338616633386461323737 +38383337316130633038323065633539303834343336663936333264383663323335623666666230 +38613535643231343662343833653461633834396234613738636534653037663261616538623436 +61623833653937396634343839313537336135663361653036626333333761623432323666653438 +34363763646133313962376438333930333833626562313362343331623839383666313738353962 +36616465393537393837643533386331653433383430656631653934346563666561616464643337 +61373362623133313734383736633366393266303734343263323666396438313736386662633038 +32303363663437643762306466643538616365396432363961616435636637663265336332363961 +61663466383935376630356635356162636563623533343335656465643632393435343430306561 +30313162373337353037383566313963363464633839393536393530623261366464313537306530 +31316632303738663338366432323731333262373032656336363333663431646136373361386566 +62363761333063346634306435356338633739613036626162346330313237346134326430623239 +38643039306161623631323864653766393463316366613434346134396132376130343130313238 +66643739316262616130656630376235653262383266396231373036643361313462643535663734 +64323730346366633462613536646164366165643930396238616536663439653431646537363039 +30373263313439396163666631363731306461666431623339326136383466366333366438656364 +38346464626634653536356161653931626562303861383965396464326335663737393932333064 +65656535663564623332373635373834333733396234333162336666306362653864363962333261 +32613937633637623332363837346663373639633064383738653833663365353062306564323666 +63643430393266303765646439303161343937643131383438333934383732623166336432616634 +31653133393263653234383664623530326263306332343730333964663062323737643739323735 +37366231393437633731363164346439373136633633363064653838633030663363646336666532 +38663134383661626337343231646162396234396135363539623162613163343064343664643363 +65396437306334316234356363303937663232323538373330623432346539363739633534666339 +38656363356635636432383663656437663665343731326361353838336362386439396233613235 +34363938363564643066363439623163383339656636643465353036396338313334336430623735 +61396662396630326431333638343565333937343834393161623439373337666535626239323262 +66623634653966336232303536333532633034323166643439616539373265303366383962616232 +39386662326461646434373636356538306237386438306432373531363565376132646636356231 +30313930326663303235343735653238353037396366656634626637373264343563613130303032 +38323533623338363661393864643563663333396464393739356335646265323166363432393864 +61623933303261356565646437656166376238643531313935653938323535396636346433376162 +32373765303133666534313763306664363061366538633434303363613531363366396533363534 +34353133333238326630323839373035633366343739363334336665646530636436346237396431 +64356462623737383636376437306161356132653133383566636663626230646563323264383035 +39663832326333323962653130383738316364616336313338613635626531393864383335396130 +39353236373766653866383432373538363062323863643265393162393730366163303430373261 +36373438316366363235363431666637386264323962613731363365666536616562303238386637 +30633861366633613363373437326635656234343832623961623339326436323639363030346162 +64643165636135323830363931353530656534613335333632623061366463653661376334613730 +38376361363833393064643764316465633532623561303865366165333633663066623833633133 +36653431666565623238323666356136626637396136356662613330386230346632363266316135 +34643465376361613033323062376364373638383037313133303761383935613064613561313038 +61633066313332393538616165386264636435636334623763363266633331376332373235666238 +33633635386361323933653636666430363433363734613538373031323166313835353465323836 +36626433633632633961376332623830333862663731653663326464333534383934336535333537 +66623834616230633161663262376136636665306338646435656535366663656335643562616233 +37356330383565343365383438656338626565663063663438343532306135373838363564313162 +61653562613636376661356365653137633661623162313930346565366566336536363036656462 +64316366633233343566323763326636623635356263393166666532653732636261373739643566 +66636532363364393336323235333362313633346337653235383131656166616661623063636433 +34623833363139326233326566303436343738653434656439313536383937646632616138656266 +64656236663462656562333162353865663462353630333561383462633533613863393635613039 +38663633663235343931666163666332356561333833616433316436646435393432663266643335 +62373462653837396266313533393135306433313231376134636237343363343133386339316165 +64636361386261373334643239376137393165396333366362343230336335343835313764303635 +38336639393436666137323938366339373435666633386361373433373063643339643262613062 +37613438633930333866316334366537313433356636323437326163613430633231366430636138 +30636264343938363036373735383065376164333139313338316434656630616664656133616333 +35346339373265613164343863393131363065326435636664373062396435396261386664656336 +66363562353532333034636466666436376265353635333030633235393566386530623335386431 +65373566333139313561376464643635663135373437616164653931633035663932383932353431 +32336438343933346138313936633063333439343865393930336633373730646331656630623636 +39626433333264653339326237653935643763393262626264626362336464303330666561353930 +30306131396362323937646663633131303262326231656234663936373735373062313437376466 +35633333333039303830643839336237356132663738313362326462633763663066636336313032 +39313532643664333137323739643036633036333539663736663233303733663234376366633033 +63343738326564333561636165653839333131333137326332646664323639383232623761653163 +65646131346563373130393637613439663861393333303337383566636137316333363562623430 +63363636663263656464636265393339616164303736323030646531643665653562623730363736 +62656366343039313733396265633765366536383266643062643364666137333936373965303134 +36633939316433376333306338393464623836383033623962303930303465393435646562613436 +35656532613462326562306566343335333466303261353331393135313030633266346131383666 +36613166646266363634336332663537663863346666646161393030616639666133326638366636 +39393763613666343864393434373437383138646562366332353733646538613834316130363635 +36623663653766653433636230303436393433396262386236353139653938366334643138663034 +34396230393334306261663564343463623764306635613736396162346335323038383437303964 +66363464393238633830323730336539653062663962356536383832623130343837353231306439 +63646533613364613837353133623334396136376637373832333038346664613365313336326261 +62313937613938366563656632663265636538613438346531356538383464313739616231336564 +61343237363331623238636463313366376533653536356338623662633833626231356236613265 +39366536646336343336323533396264323062353963303732323832613533396332386434646134 +64356664666365633730313336626163653730333262316333613930303863626665616133346462 +35623964326131353161656636306630353939373462383663396430313335643832366533313630 +30313934333136356238333635313331346464353433393332663832336136653532653035363637 +36616166343231373166323466386131306233373232383561396466393863653762626261353164 +38363132666364396437363961303664623766383232313431663737323365653266623832313934 +38666132653962663665306237356262336237326137303033316239363134306438326230653137 +63653561323764383636643763663865663036366530636663373136383030303765333361323839 +36666164376136333761333264303437653534336430353034323464323833656135363464616232 +66336632623966383134303261623661386362363865373364313135616466316631333231623532 +62646130336435303534346437303936303436303764346539396662653266333035303936303338 +65333639393130303837303538633964656365653261653864633336323332323733643338353935 +31636331353436363134623038383536643363333330666662353638326533353532663835316364 +62346265633862646163613230346335316233353236303836636531383661343830366336633230 +35633537626130393433323761633232366364636138313537656430613338366561666462343233 +61333138303230616165383038393164373164623964326561356231633065616236626631633830 +30333233353761306431636434303034636436623465313562336231383434363965653635373536 +39393061306238333139363762363734323466376565646532636330313130376462353361623139 +65333838353062656436326362346261656331333365386336613965626638643335323638356662 +33343466363164663733313032376535633863353661323366636239313763663739626537336433 +36393162326161353431313462626534623164626362376661343636343261316637626462646634 +66353561396432643135376230666139653262396638663538373766303334316131346339316262 +31383237303339303737646533663132393439336633363132356132646231653835643735663034 +64343034396530396264613230653237336366666338383866366233306336373465653935306135 +32306330346430336263313564663330656335393761386335633836643563396265356339633734 +31396466383737623431623566323762363666316132396263623435663833623930646666366161 +39353538383263323163303964306634633265636465316461386237313138363935643263613666 +65343266303364303236306661343037323132323036653536306664363664306338383835383739 +37396334616161326161353533326130366132386463646132323631333733393861386633386535 +33326265356239656132353263633838346135353238303562633432346630306533313636623266 +39663932633631386133646663643338323666363963646565393536343366343130393232333463 +38643866663662666265356631303665303936663632356230633135643764326265333335343639 +35373836366235383233313731316238613136393764366336623466383032666163366261373363 +38366263316635656561383831303263333030383033616564663430383033643434386637626530 +38343236336266323536663133336164613238303833363962353132663365653034316564613966 +39373662343262633164353530636433363361323465336361393862366463393838353437346632 +30323633643730653761343661336239346636396163636136363135363232626236393935396163 +64363364626362323639613666386638363534376633386236663462303332646632636633353637 +61393263336537623062643861396537373237663264356130386133306132396265373634643737 +30616235333265386430663766636332633830366365636263346465656137376234383535343130 +34376130643433326164653330383462373237623238333664623964623335633164313239363936 +32373132613134643436333461333330303239313935663163373062393065376362313535646330 +61306362653562643263636463306237313837663837663636616230373737396561633532363334 +62363638643564343433363663303662383632326433366462616538396633633262376461363936 +35356438313530336563356234363265333864326536663738656462633237666631333766666435 +64383132653536313166666436653936613230336633326536343730333564636630626430333639 +63623234356662396466653332353930386666306235376263623638646438353865656631393462 +34346462356336303132326461613461653636323866623963396363313836663031656531663462 +64623030313263363634626563386662386636356566336637653564366163363839646534373433 +30666561663034663431306434626637336231383564643935636563363833346263383338663336 +62653663396635346463386231303165636436653466353437336265323966336266636231363338 +37633963346132303837343662393535643162383961643733356633613130313139626162303833 +62396438303561643165336661373835663665353738653739656462393163376132306339373930 +61393435316631653732653631363536353865643433303234346461326566376466666531653439 +34623966666465613030333437636164356136386239316662373064653635326134646535393935 +30383532653665643933343964353562623230383639303739313163343664343762633963653234 +30363839346465356666656634646365663438633034346333356336653432373032346233663765 +38303335353464343665306266303932353633643631346639353261653339383332623564343965 +39326531353939656231643063613534396436663536306333336232323538303436393939363334 +32346439323863306237363433613635613333663536626264313336663662663037616666366361 +30303734316264333031633034393165353561346135376432303765333261356235313561383336 +36643533313634306635323335326231306464666364393037373562353762653531636338626139 +35393937393466393961373836336365656430323365613534623139643231366465313032343564 +66303732303839643732333737643733333836353736363539313034336162353034633961346137 +65386231616331346466653230353037373265366565396162373261373034333934393739316162 +33363834376632356532663034343861653036633833366663613235346631386436633565316137 +32323466393037393065376330366231363563653765633462623364376132643935366638633266 +35376439373465643462373937396161616631333039306265633433353435373536623165393334 +39646636636333656565623030313338633031306139343633653130313364313037353835633037 +34666535323436353262336461336635636532616432663032323536323166363564623564633264 +38353731616264393030393462633939646263323638356463663734633337306234373639313062 +61316435383538383961376533396665363031373066663131613331316564636463646665346231 +34366263653738666361646665313735346431333262643765616137633039646438303832616362 +30363863656430633462393737386264326230636435393539393931666562323335333962343866 +34336164643134623465393164616439613530306566333636633164343166343336333234366536 +34663335303636636462386638346665306230363532353933316162393035613836623135373563 +64653133666132303534373630626661363435396633646634653865313864613361366165383465 +63333039646437303730623261303530633932626539363533623864326332306636396163303131 +35306434326165373638333137336663303238353234623137336165326133666339346563383033 +62633934636666316133643866393764383030343334373363393535363731303130623932663466 +64326236383130356632656635663134346164306330656432653461363730613866393164323035 +39346361643465653062336633663237613933613735623338636330616132363534363165376136 +63616533646666353565343438303435346433356463306535356561373261356333663838366530 +36396633633361303535663631623365363036663935646337656135396633366664663131623837 +32663437646665623761343562643534636632626133633638343231623130306534613233653136 +64383737653663646166623634383861323430623331346562396235356237303061303036633233 +37343264633537623166396231643737643764626366646139653166663431383636633765626537 +62306365623433633732313834323435366238653463663835663237666334353361356162643865 +32366162313062343261333362343732343137633764643331616662663264353131306135633930 +65383136376562643430306237303566376630656434653435313230633034316262613635363030 +39613433356437353937633637333230323839373265366664316131616130383330616232336265 +33636439663938363732383033376631633333306633656533306632303332646531643362306138 +38663433376564343338373838636333653461396436613639633535646638393032383765663031 +62393561303139336231323033333834623861313063313433643931333839333161373232623339 +35383766633362346335356335306564343764316130303235636661366630356534626339356233 +61373230376662386565303537663234373663346165326131663730306131303462326637613764 +37393063656161653238623762393135313732363136323364343639663266626638353564386564 +63643265336631636565613634643664343566373864313730393937613861353234313265386661 +62663565363031343938366339353238343933393630343334623734333830393163623330356535 +66333863376361393036343237323734386139373565323830653062383633306630363638323132 +33393233333462363031336531613031386434656232326536323233346335666366303030623633 +66323632333664643334343931363635636631643134623661663361386535396264636461353033 +32333866363536326162653130633132363065376337326439383630383565323530626139313165 +62623962613637313263623335346131623631656363323566613236373365313636326630303635 +64386261643561323265333564386163376331383562373337353032393436336561366265383037 +35386561646139326462313864323833323664363736306665616535333636663737656530336231 +35646136636130613466343738383332613763363463666631353637353863313330376137613233 +62633439376239316231353334343435616561306137333534363765396265363530303531303366 +36396562336261626562363963373232313439653936376238386232653638393239343237323865 +3664 From bcfa43bf9dad307a756b10c267a969e94644dfc5 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 22 Aug 2026 21:12:34 +0100 Subject: [PATCH 13/16] Update borg keys --- ansible/roles/borg/vars/main/keys.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ansible/roles/borg/vars/main/keys.yml b/ansible/roles/borg/vars/main/keys.yml index 64a21bca..f1be0d2c 100644 --- a/ansible/roles/borg/vars/main/keys.yml +++ b/ansible/roles/borg/vars/main/keys.yml @@ -1,11 +1,11 @@ $ANSIBLE_VAULT;1.1;AES256 -34326663643266306162376261383566646364376639613137646237313636303430363739646631 -3762303366303532386362356135313462613639323330630a333937623737366231656264623065 -66643731373537326437383465386139373539653030343930646434313262386565323637356539 -3962383331353331310a363163383538636133623137633930393632653930643664306663366363 -62613233383935633533343861343864363131313435383237333738343766306565353463653337 -35336632646538373539333563393433336532393137633062353265636533666134346464383961 -33323562643462646436366133333566653565613537326137393164306165386166633539383663 -38616462386432623531653564623032626632353561656431336634373530633038626665633230 -33636639643037366332613264356463633262653663393531643932636335353163396431393465 -3162666530626433313865656164613434626334353465333738 +61313331636537316436653462356565636439656231333534383635346164653062306232373839 +3764396266326162373832633330343363376262613133330a356530323132613964336136323434 +63656162303261393037656562373963666333393165373363376366366262653335636666653264 +3461303635663765650a393465656164353536333865633962313330386561373266313636353465 +32623431316334336263396664653632303032623064323234393165333636643734633063383236 +62643366356434303664396366303537396266636139313663633461356363316337323663366435 +64353763316463386362656663386666326162633438623762366161613362333836373131396362 +64326531653966386266366530393861353538353430313739313863366564323736373464333235 +66616561623262366636356532663339393164356638653731386330343434326437656230393766 +6166326361366239336638353530613133356430326334366530 From ac9999dcb4df746dcb6d16183fade41d533889d4 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 22 Aug 2026 21:45:04 +0100 Subject: [PATCH 14/16] Update borg version --- ansible/roles/borg/vars/main/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/borg/vars/main/main.yml b/ansible/roles/borg/vars/main/main.yml index 558fb73f..8cc8f97a 100644 --- a/ansible/roles/borg/vars/main/main.yml +++ b/ansible/roles/borg/vars/main/main.yml @@ -4,7 +4,7 @@ borg_home: /var/lib/borg borg_virtualenv: "{{ borg_home }}/borgmatic-venv" # Pinned to a specific commit for S3 compatibility. -borg_git_version: "1373b30ba8e6b88f6264dc57f6a8da46d8b2e80f" +borg_git_version: "05aa93444e99076fc30743d3769442a0eefd6f88" borgmatic_version: "2.0.11" # see https://wiki.archlinux.org/title/Systemd/Timers From 45aecf26d8ae871b5e037ecc839c583c9d95c8c2 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 22 Aug 2026 23:17:52 +0100 Subject: [PATCH 15/16] Rename variable --- ansible/roles/borg/tasks/main.yml | 2 +- ansible/roles/borg/vars/main/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml index 6c76056b..79bc968a 100644 --- a/ansible/roles/borg/tasks/main.yml +++ b/ansible/roles/borg/tasks/main.yml @@ -35,7 +35,7 @@ virtualenv: "{{ borg_virtualenv }}" name: - borgbackup[s3] @ git+https://github.com/borgbackup/borg.git@{{ borg_git_version }} - - borgmatic=={{ borgmatic_version }} + - borgmatic=={{ borg_borgmatic_version }} state: present tags: - role::borg diff --git a/ansible/roles/borg/vars/main/main.yml b/ansible/roles/borg/vars/main/main.yml index 8cc8f97a..22ec3179 100644 --- a/ansible/roles/borg/vars/main/main.yml +++ b/ansible/roles/borg/vars/main/main.yml @@ -5,7 +5,7 @@ borg_virtualenv: "{{ borg_home }}/borgmatic-venv" # Pinned to a specific commit for S3 compatibility. borg_git_version: "05aa93444e99076fc30743d3769442a0eefd6f88" -borgmatic_version: "2.0.11" +borg_borgmatic_version: "2.0.11" # see https://wiki.archlinux.org/title/Systemd/Timers # or for more details https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html From 8590a6f6fa6cedd1ce2b6920f8baf2eb0bea1dd2 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 22 Aug 2026 23:30:26 +0100 Subject: [PATCH 16/16] Add existence check before creating new repos --- ansible/roles/borg/tasks/main.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ansible/roles/borg/tasks/main.yml b/ansible/roles/borg/tasks/main.yml index 79bc968a..e68851e3 100644 --- a/ansible/roles/borg/tasks/main.yml +++ b/ansible/roles/borg/tasks/main.yml @@ -105,13 +105,27 @@ notify: - Reload the systemd daemon +- name: Check for existence of borg repositories + become: true + become_user: "{{ borg_user }}" + command: > + {{ borg_virtualenv }}/bin/borg repo-list + --repo b2:{{ borg_s3_access_key_id }}:{{ borg_s3_access_key_secret }}@https://eu-central-1.linodeobjects.com/borg/database-backups/ + register: borg_repositories + changed_when: false + failed_when: false + tags: + - role::borg + - name: Create borgmatic repositories + become: true become_user: "{{ borg_user }}" command: "{{ borg_virtualenv }}/bin/borgmatic repo-create --encryption=none" environment: POSTGRES_PASSWORD: "{{ vault_postgres_user_passwords.borg }}" BORG_S3_KEY_ID: "{{ borg_s3_access_key_id }}" BORG_S3_KEY_SECRET: "{{ borg_s3_access_key_secret }}" - # creates: "{{ borg_home }}/keys/repositories/borg2" + when: borg_repositories.rc != 0 + changed_when: borg_repositories.rc != 0 tags: - role::borg