Refactored for proper docker and mailcow setup

This commit is contained in:
2026-04-13 09:28:25 -04:00
parent d78a3d9133
commit 8aea5f0077

View File

@@ -1,8 +1,19 @@
--- ---
- name: Restart main Docker stack - name: Tear down Mailcow and main Docker stack(s) (LIFO)
become: true become: true
community.docker.docker_compose_v2: community.docker.docker_compose_v2:
# This targets the first directory in the list you defined in your host_vars project_src: "{{ item }}"
project_src: "{{ docker_compose_dirs[0] }}" state: absent
state: restarted # Drops Mailcow first, THEN loops through your main stacks
loop: "{{ [mailcow_dir | default('/data/mailcow')] + (docker_compose_dirs | default([])) }}"
listen: Restart main Docker stack
- name: Bring main Docker stack(s) and Mailcow back up (FIFO)
become: true
community.docker.docker_compose_v2:
project_src: "{{ item }}"
state: present
# Brings your main stacks up first (recreating the network), THEN Mailcow
loop: "{{ (docker_compose_dirs | default([])) + [mailcow_dir | default('/data/mailcow')] }}"
listen: Restart main Docker stack