docker: remove orphans

This commit is contained in:
Gabriel Augendre 2024-10-17 16:52:38 +02:00
parent a19f54552b
commit 7e5807e009
3 changed files with 5 additions and 2 deletions

View file

@ -2,3 +2,4 @@
docker_app_name: some-app
docker_dir: /mnt/data/{{ docker_app_name }}
docker_build: policy
docker_remove_orphans: true

View file

@ -1,12 +1,13 @@
---
- name: Stop service
listen: Restart service
community.docker.docker_compose_v2:
project_src: "{{ docker_dir }}"
state: stopped
listen: Restart service
- name: Start service
listen: Restart service
community.docker.docker_compose_v2:
project_src: "{{ docker_dir }}"
state: present
build: "{{ docker_build }}"
listen: Restart service
remove_orphans: "{{ docker_remove_orphans }}"

View file

@ -30,3 +30,4 @@
community.docker.docker_compose_v2:
project_src: "{{ docker_dir }}"
state: present
remove_orphans: "{{ docker_remove_orphans }}"