Skip to content

Commit

Permalink
docker_cleanup: limit default pruning to images only and make it conf…
Browse files Browse the repository at this point in the history
…igurable
  • Loading branch information
skylenet committed Dec 12, 2024
1 parent e5fdf85 commit 05654e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions roles/docker_cleanup/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docker_cleanup_cron_name: docker-clean-up
docker_cleanup_schedule: ["0", "0", "*", "*", "*"] # Cron format https://en.wikipedia.org/wiki/Cron
# Defaults to 00h00 every day
docker_cleanup_command: "docker image prune -f"
2 changes: 1 addition & 1 deletion roles/docker_cleanup/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
day: "{{ docker_cleanup_schedule[2] }}"
month: "{{ docker_cleanup_schedule[3] }}"
weekday: "{{ docker_cleanup_schedule[4] }}"
job: "docker system prune -f &>/dev/null"
job: "{{ docker_cleanup_command}}"

0 comments on commit 05654e1

Please sign in to comment.