From 9fb16d3a69a709179a5fc30bede2e6e61b1a87a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Mon, 4 Mar 2024 09:20:04 +0100 Subject: [PATCH] Address comments by @samsapti We need to use ':' instead of '=' in yaml for environment variable bindings. Spurious tab where it should be all spaces Rename variable mail-from to mail_from to align with existing code style Nit: change email addresses --- roles/docker/defaults/main.yml | 2 +- roles/docker/templates/compose-files/restic.yml.j2 | 4 ++-- roles/docker/templates/restic/failure.sh.j2 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index dcb58b2..d181a8b 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -53,7 +53,7 @@ services: # mail dance domain: "noreply.{{ base_domain }}" allowed_sender_domain: true - mail-from: "noreply@noreply.{{ base_domain }}" + mail_from: "backup@noreply.{{ base_domain }}" docker_registry: domain: "docker.{{ base_domain }}" diff --git a/roles/docker/templates/compose-files/restic.yml.j2 b/roles/docker/templates/compose-files/restic.yml.j2 index b69571e..ce3c101 100644 --- a/roles/docker/templates/compose-files/restic.yml.j2 +++ b/roles/docker/templates/compose-files/restic.yml.j2 @@ -15,7 +15,7 @@ services: --tag datacoop-volumes --exclude '*.tmp' --exclude '/mnt/volumes/mastodon/mastodon_data/cache/' - --exclude '/mnt/volumes/restic/' + --exclude '/mnt/volumes/restic/' --verbose RESTIC_FORGET_ARGS: >- --keep-last 10 @@ -23,7 +23,7 @@ services: --keep-weekly 5 --keep-monthly 12 TZ: Europe/Copenhagen - POST_COMMANDS_FAILURE=/run/libexec/failure.sh + POST_COMMANDS_FAILURE: /run/libexec/failure.sh volumes: - "./ssh:/run/secrets/.ssh:ro" - "./scripts:/run/libexec:ro" diff --git a/roles/docker/templates/restic/failure.sh.j2 b/roles/docker/templates/restic/failure.sh.j2 index 5f8411d..e0d49ef 100644 --- a/roles/docker/templates/restic/failure.sh.j2 +++ b/roles/docker/templates/restic/failure.sh.j2 @@ -1,5 +1,5 @@ #!/bin/sh -curl smtp://postfix --mail-from {{ services.restic.mail-from }} --mail-rcpt admin-hold@data.coop --upload-file . << END_OF_MAIL +curl smtp://postfix --mail-from {{ services.restic.mail_from }} --mail-rcpt admin@data.coop --upload-file . << END_OF_MAIL From: Restic backup <{{ services.restic.mail-from }}> To: admin-hold@data.coop Subject: Restic backup failed