From 39293c25281f2046dc7ea6ffa4c486b506cffcd7 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 14 Dec 2023 00:22:35 +0100 Subject: [PATCH] Made docker backup before docker update obligatoric --- .../templates/backup-docker-to-local.service.j2 | 2 +- roles/update-docker/templates/update-docker.service.j2 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/backup-docker-to-local/templates/backup-docker-to-local.service.j2 b/roles/backup-docker-to-local/templates/backup-docker-to-local.service.j2 index 7b5af3f2..84e076dc 100644 --- a/roles/backup-docker-to-local/templates/backup-docker-to-local.service.j2 +++ b/roles/backup-docker-to-local/templates/backup-docker-to-local.service.j2 @@ -1,5 +1,5 @@ [Unit] -Description=docker volume backup +Description=backup docker volumes to local folder OnFailure=systemd-notifier@%n.service cleanup-failed-docker-backups.service [Service] diff --git a/roles/update-docker/templates/update-docker.service.j2 b/roles/update-docker/templates/update-docker.service.j2 index 6c75f722..7d5f30d5 100644 --- a/roles/update-docker/templates/update-docker.service.j2 +++ b/roles/update-docker/templates/update-docker.service.j2 @@ -4,6 +4,7 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot +ExecStartPre=/bin/sh -c 'systemctl start backup-docker-to-local.service' ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_maintenance_service_freezer_script }} freeze "{{ system_maintenance_services | reject('equalto', "update-docker") | join(',') }}"' ExecStart=/bin/sh -c '/usr/bin/python {{update_docker_script}} {{path_docker_compose_instances}}' ExecStartPost=/bin/sh -c 'systemctl start system-maintenance-service-defrost.service' \ No newline at end of file