Sfoglia il codice sorgente

add cronjob to quadlet for auto clearing podman data

Blaine Story 4 giorni fa
parent
commit
e25e24df04
1 ha cambiato i file con 10 aggiunte e 0 eliminazioni
  1. 10 0
      roles/quadlet/tasks/main.yml

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

@@ -32,6 +32,7 @@
     mode: '0770'
   with_items:
     - "{{ persistent_container_dirs }}"
+  failed_when: false
   loop_control:
     label: "{{ item }}"
 
@@ -71,5 +72,14 @@
     - 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
   meta: flush_handlers