2025-02-04 18:14:37 +01:00
|
|
|
- name: "load variables from {{ role_path }}/vars/docker-compose.yml for whole play"
|
|
|
|
include_vars: "{{ role_path }}/vars/docker-compose.yml"
|
2025-01-30 15:04:23 +01:00
|
|
|
|
2025-02-04 18:14:37 +01:00
|
|
|
- name: "remove {{ docker_compose.directories.instance }} and all its contents"
|
2024-01-08 15:14:55 +01:00
|
|
|
file:
|
2025-02-04 18:14:37 +01:00
|
|
|
path: "{{ docker_compose.directories.instance }}"
|
2024-01-08 15:14:55 +01:00
|
|
|
state: absent
|
2024-01-08 19:38:36 +01:00
|
|
|
when: mode_reset | bool
|
2024-01-08 15:14:55 +01:00
|
|
|
|
2025-02-04 18:14:37 +01:00
|
|
|
# This could lead to problems in docker-compose directories which are based on a git repository
|
|
|
|
# @todo Verify that this isn't the case. E.g. in accounting
|
|
|
|
- name: "Create all docker-compose directories (including parent directories)"
|
2024-01-08 15:14:55 +01:00
|
|
|
file:
|
2025-02-04 18:14:37 +01:00
|
|
|
path: "{{ item.value }}"
|
2024-01-08 15:14:55 +01:00
|
|
|
state: directory
|
2025-02-04 18:14:37 +01:00
|
|
|
mode: '0755'
|
|
|
|
with_dict: "{{ docker_compose.directories }}"
|
2025-01-29 14:20:34 +01:00
|
|
|
|
|
|
|
- name: flush docker service
|
|
|
|
meta: flush_handlers
|
|
|
|
when: run_once_docker_compose is not defined
|
|
|
|
|
|
|
|
- name: run the docker tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_docker_compose: true
|
|
|
|
when: run_once_docker_compose is not defined
|