Ajout d'une tâche planifiée pour réaliser un docker system prune tous les jours

This commit is contained in:
Navas 2024-04-21 10:34:03 +02:00
parent 8eced22395
commit 716530b2e8
2 changed files with 9 additions and 1 deletions

View File

@ -77,6 +77,12 @@
state: started
enabled: true
- name: Configure tâche cron pour docker system prune
ansible.builtin.template:
src: docker_prune.j2
dest: /etc/cron.daily/docker_prune
mode: u=rwx,g=rx,o=rx
- name: Traefik network
community.docker.docker_network:
name: traefik
@ -102,4 +108,3 @@
args:
chdir: /opt/traefik/
when: docker_host_traefik_enabled and traefik_compose_file.changed

View File

@ -0,0 +1,3 @@
#!/bin/bash
# {{ ansible_managed }}
docker system prune -a -f | logger -t docker_prune