diff --git a/tasks/main.yml b/tasks/main.yml index b0e9db0..134b96d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 - diff --git a/templates/docker_prune.j2 b/templates/docker_prune.j2 new file mode 100644 index 0000000..54ad972 --- /dev/null +++ b/templates/docker_prune.j2 @@ -0,0 +1,3 @@ +#!/bin/bash +# {{ ansible_managed }} +docker system prune -a -f | logger -t docker_prune