diff --git a/playbooks/roles/docker_compose/tasks/main.yaml b/playbooks/roles/docker_compose/tasks/main.yaml index e8cfcd0..8e211c1 100644 --- a/playbooks/roles/docker_compose/tasks/main.yaml +++ b/playbooks/roles/docker_compose/tasks/main.yaml @@ -111,3 +111,11 @@ minute: "0" hour: "5" job: "cd /ansible_docker_compose; docker compose pull && docker compose up -d" + +- name: Install automatic cleanup cron job + become: true + ansible.builtin.cron: + name: 'docker compose auto update' + minute: "23" + hour: "4" + job: "docker system prune -a -f"