mirror of
https://github.com/natelandau/ansible-homelab-config.git
synced 2025-11-16 17:03:49 -05:00
feat: purge dangling Docker containers on job sync
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
nocows = True
|
nocows = True
|
||||||
roles_path = ./galaxy-roles:./roles
|
roles_path = ./galaxy-roles:./roles
|
||||||
collections_paths = ./
|
collections_path = ./
|
||||||
inventory = ./inventory.yml
|
inventory = ./inventory.yml
|
||||||
stdout_callback = yaml
|
stdout_callback = yaml
|
||||||
any_errors_fatal = True
|
any_errors_fatal = True
|
||||||
|
|||||||
@@ -74,3 +74,15 @@
|
|||||||
dest: "{{ docker_compose_file_location }}/{{ item | basename | regex_replace('.j2$', '') }}"
|
dest: "{{ docker_compose_file_location }}/{{ item | basename | regex_replace('.j2$', '') }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
with_fileglob: "../templates/docker_compose_files/*.j2"
|
with_fileglob: "../templates/docker_compose_files/*.j2"
|
||||||
|
|
||||||
|
- name: "Prune docker caches"
|
||||||
|
community.docker.docker_prune:
|
||||||
|
containers: true
|
||||||
|
images: true
|
||||||
|
images_filters:
|
||||||
|
dangling: false
|
||||||
|
networks: true
|
||||||
|
volumes: true
|
||||||
|
builder_cache: true
|
||||||
|
when:
|
||||||
|
- is_docker_compose_client or is_nomad_client or is_nomad_server
|
||||||
|
|||||||
Reference in New Issue
Block a user