From c921cfc6db26cca7e572820dc8ae8a8d6ac7daf7 Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sat, 21 Nov 2026 02:28:48 +0100 Subject: [PATCH] feat: Add app-backrest profile (backrest + restic via cloud-init) Installs the latest backrest release, run as root by a systemd unit listening on 0.0.0.0:9898, with its config in /etc/backrest/config.json and its data in /var/lib/backrest. Backrest downloads and maintains the restic version it requires (>= 0.19.1, Ubuntu ships 0.18.1) in /var/lib/backrest/restic, symlinked to /usr/local/bin/restic for CLI use. Meant for a backup instance mounting volume-*-ro profiles (POC). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6 --- .../applications/app-backrest.profile.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 profiles/applications/app-backrest.profile.yaml diff --git a/profiles/applications/app-backrest.profile.yaml b/profiles/applications/app-backrest.profile.yaml new file mode 100644 index 0000000..27e7d59 --- /dev/null +++ b/profiles/applications/app-backrest.profile.yaml @@ -0,0 +1,40 @@ +name: app-backrest +description: Install backrest and its restic (web UI on port 9898) +config: + cloud-init.vendor-data: | + #cloud-config + package_update: true + package_upgrade: true + timezone: Europe/Paris + locale: fr_FR.UTF-8 + packages: + - curl + write_files: + - path: /etc/systemd/system/backrest.service + permissions: "0644" + content: | + [Unit] + Description=Backrest (restic web UI) + After=network-online.target + Wants=network-online.target + + [Service] + Type=simple + # root : lecture de tous les fichiers des volumes montés en lecture seule + User=root + ExecStart=/usr/local/bin/backrest + Environment="BACKREST_PORT=0.0.0.0:9898" + Environment="BACKREST_CONFIG=/etc/backrest/config.json" + Environment="BACKREST_DATA=/var/lib/backrest" + Restart=on-failure + + [Install] + WantedBy=multi-user.target + runcmd: + - mkdir -p /etc/backrest /var/lib/backrest + - curl -fsSL https://github.com/garethgeorge/backrest/releases/latest/download/backrest_Linux_x86_64.tar.gz | tar xz -C /usr/local/bin backrest + - systemctl daemon-reload + - systemctl enable --now backrest + # restic en CLI (restauration, tests) : celui que backrest télécharge et + # maintient à la version requise (celui d'Ubuntu est trop ancien pour backrest) + - ln -sf /var/lib/backrest/restic /usr/local/bin/restic