From 8d04397b9146d7297e33fc0490dd33749145cceb Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 16 Nov 2023 15:18:11 +0100 Subject: [PATCH] Optimized docker update --- roles/update-docker/handlers/main.yml | 12 ------------ roles/update-docker/tasks/main.yml | 19 +++++++++++++------ .../templates/update-docker.service.j2 | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 roles/update-docker/handlers/main.yml diff --git a/roles/update-docker/handlers/main.yml b/roles/update-docker/handlers/main.yml deleted file mode 100644 index ad1c55a9..00000000 --- a/roles/update-docker/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: "reload disc-space-check.service" - systemd: - name: disc-space-check.service - state: reloaded - enabled: yes - daemon_reload: yes -- name: "restart disc-space-check.timer" - systemd: - name: disc-space-check.timer - state: restarted - enabled: yes - daemon_reload: yes diff --git a/roles/update-docker/tasks/main.yml b/roles/update-docker/tasks/main.yml index 82570d2e..c026ec86 100644 --- a/roles/update-docker/tasks/main.yml +++ b/roles/update-docker/tasks/main.yml @@ -1,9 +1,16 @@ -- name: configure docker-volume-backup-cleanup.service - template: - src: docker-volume-backup-cleanup.service.j2 - dest: /etc/systemd/system/docker-volume-backup-cleanup.service - - name: create {{update_docker_script}} copy: src: update-docker.py - dest: "{{update_docker_script}}" \ No newline at end of file + dest: "{{update_docker_script}}" + +- name: configure update-docker.service + template: + src: update-docker.service + dest: /etc/systemd/system/update-docker.service + +- name: "reload update-docker.service" + systemd: + name: update-docker.service + state: reloaded + enabled: yes + daemon_reload: yes \ No newline at end of file diff --git a/roles/update-docker/templates/update-docker.service.j2 b/roles/update-docker/templates/update-docker.service.j2 index a6690ea8..3e438cc0 100644 --- a/roles/update-docker/templates/update-docker.service.j2 +++ b/roles/update-docker/templates/update-docker.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot -ExecStart=/bin/sh -c '/usr/bin/python {{update_docker_script}} {{docker_volume_backup_cleanup_trigger_directory}}' \ No newline at end of file +ExecStart=/bin/sh -c '/usr/bin/python {{update_docker_script}} {{path_docker_compose_files}}' \ No newline at end of file