clustered-fucks/playbooks/docker-prune.yml
2026-01-23 14:36:08 +00:00

19 lines
486 B
YAML

---
- name: Docker cleanup on all hosts
hosts: docker_hosts
become: yes
gather_facts: no
tasks:
- name: Prune with docker CLI
shell: |
docker image prune -f
docker network prune -f
docker builder prune -f
register: prune_result
changed_when: "'Total reclaimed space' in prune_result.stdout"
- name: Show prune output
debug:
var: prune_result.stdout_lines
when: prune_result.stdout_lines | length > 0