Tie podman-image-prune to podman-auto-update

This commit is contained in:
Wojciech Kozlowski 2022-10-30 16:21:27 +01:00
parent da2236a6cd
commit 814cec050f
2 changed files with 4 additions and 11 deletions

View File

@ -1,6 +1,7 @@
[Unit] [Unit]
Description=Prune dangling podman images Description=Prune dangling podman images
Documentation=man:podman-image-prune(1) Documentation=man:podman-image-prune(1)
After=podman-auto-update.service
[Service] [Service]
Type=oneshot Type=oneshot
@ -8,4 +9,4 @@ ExecStartPre=/usr/bin/podman container prune -f
ExecStart=/usr/bin/podman image prune -f ExecStart=/usr/bin/podman image prune -f
[Install] [Install]
WantedBy=multi-user.target WantedBy=podman-auto-update.service

View File

@ -113,12 +113,6 @@
dest: "{{ service_home }}/.config/systemd/user/podman-image-prune.service" dest: "{{ service_home }}/.config/systemd/user/podman-image-prune.service"
register: user_systemd_podman_image_prune_service_file 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 - name: SystemD daemon reload
systemd: systemd:
daemon_reload: true daemon_reload: true
@ -126,8 +120,7 @@
when: when:
user_systemd_podman_auto_update_service_file is changed or user_systemd_podman_auto_update_service_file is changed or
user_systemd_podman_auto_update_timer_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_service_file is changed
user_systemd_podman_image_prune_timer_file is changed
- name: Enable podman auto-update - name: Enable podman auto-update
systemd: systemd:
@ -138,9 +131,8 @@
- name: Enable podman image prune - name: Enable podman image prune
systemd: systemd:
name: podman-image-prune.timer name: podman-image-prune.service
enabled: yes enabled: yes
state: started
scope: user scope: user
become_user: "{{ service_user_name }}" become_user: "{{ service_user_name }}"