Ajout d'une tâche planifiée pour réaliser un docker system prune tous les jours
This commit is contained in:
parent
8eced22395
commit
716530b2e8
2 changed files with 9 additions and 1 deletions
|
@ -77,6 +77,12 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
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
|
- name: Traefik network
|
||||||
community.docker.docker_network:
|
community.docker.docker_network:
|
||||||
name: traefik
|
name: traefik
|
||||||
|
@ -102,4 +108,3 @@
|
||||||
args:
|
args:
|
||||||
chdir: /opt/traefik/
|
chdir: /opt/traefik/
|
||||||
when: docker_host_traefik_enabled and traefik_compose_file.changed
|
when: docker_host_traefik_enabled and traefik_compose_file.changed
|
||||||
|
|
||||||
|
|
3
templates/docker_prune.j2
Normal file
3
templates/docker_prune.j2
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# {{ ansible_managed }}
|
||||||
|
docker system prune -a -f | logger -t docker_prune
|
Loading…
Reference in a new issue