Эх сурвалжийг харах

add cronjob to quadlet for auto clearing podman data

Blaine Story 4 өдөр өмнө
parent
commit
e25e24df04

+ 10 - 0
roles/quadlet/tasks/main.yml

@@ -32,6 +32,7 @@
     mode: '0770'
     mode: '0770'
   with_items:
   with_items:
     - "{{ persistent_container_dirs }}"
     - "{{ persistent_container_dirs }}"
+  failed_when: false
   loop_control:
   loop_control:
     label: "{{ item }}"
     label: "{{ item }}"
 
 
@@ -71,5 +72,14 @@
     - Daemon Reload
     - Daemon Reload
 
 
 
 
+- name: Set up cron to auto-clear old Container data
+  ansible.builtin.cron:
+    name: "clean old container data"
+    minute: "25"
+    hour: "13"
+    weekday: "2"
+    job: "podman system prune -f"
+
+
 - name: Flush handlers
 - name: Flush handlers
   meta: flush_handlers
   meta: flush_handlers