From 814cec050fa55fa693181c27440263e53ac050ed Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 30 Oct 2022 16:21:27 +0100 Subject: [PATCH] Tie podman-image-prune to podman-auto-update --- .../.config/systemd/user/podman-image-prune.service | 3 ++- playbooks/tasks/services/deploy/service/01-user.yml | 12 ++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/playbooks/filesystem/common/var/lib/_hostname/home/_service_user_name/.config/systemd/user/podman-image-prune.service b/playbooks/filesystem/common/var/lib/_hostname/home/_service_user_name/.config/systemd/user/podman-image-prune.service index f46018e..7f967a3 100644 --- a/playbooks/filesystem/common/var/lib/_hostname/home/_service_user_name/.config/systemd/user/podman-image-prune.service +++ b/playbooks/filesystem/common/var/lib/_hostname/home/_service_user_name/.config/systemd/user/podman-image-prune.service @@ -1,6 +1,7 @@ [Unit] Description=Prune dangling podman images Documentation=man:podman-image-prune(1) +After=podman-auto-update.service [Service] Type=oneshot @@ -8,4 +9,4 @@ ExecStartPre=/usr/bin/podman container prune -f ExecStart=/usr/bin/podman image prune -f [Install] -WantedBy=multi-user.target +WantedBy=podman-auto-update.service diff --git a/playbooks/tasks/services/deploy/service/01-user.yml b/playbooks/tasks/services/deploy/service/01-user.yml index 00c5074..7e677be 100644 --- a/playbooks/tasks/services/deploy/service/01-user.yml +++ b/playbooks/tasks/services/deploy/service/01-user.yml @@ -113,12 +113,6 @@ dest: "{{ service_home }}/.config/systemd/user/podman-image-prune.service" register: user_systemd_podman_image_prune_service_file - - name: Copy systemd image prune timer for user {{ service_user_name }} - copy: - src: "./filesystem/common/var/lib/_hostname/home/_service_user_name/.config/systemd/user/podman-image-prune.timer" - dest: "{{ service_home }}/.config/systemd/user/podman-image-prune.timer" - register: user_systemd_podman_image_prune_timer_file - - name: SystemD daemon reload systemd: daemon_reload: true @@ -126,8 +120,7 @@ when: user_systemd_podman_auto_update_service_file is changed or user_systemd_podman_auto_update_timer_file is changed or - user_systemd_podman_image_prune_service_file is changed or - user_systemd_podman_image_prune_timer_file is changed + user_systemd_podman_image_prune_service_file is changed - name: Enable podman auto-update systemd: @@ -138,9 +131,8 @@ - name: Enable podman image prune systemd: - name: podman-image-prune.timer + name: podman-image-prune.service enabled: yes - state: started scope: user become_user: "{{ service_user_name }}"