33 lines
1.2 KiB
YAML

- name: "Set global docker_compose_instance_directory: {{ path_docker_compose_instances }}{{ application_id }}/"
set_fact:
docker_compose_instance_directory: "{{ path_docker_compose_instances }}{{ application_id }}/"
- name: "Set global domain based on application_id"
set_fact:
domain: "{{ domains[application_id] if application_id in domains else None }}"
# Default case: One Domain exists. Some applications like matrix don't have an default key
- name: "Set global http_port to {{ ports.localhost.http_ports[application_id] }}"
set_fact:
http_port: "{{ ports.localhost.http_ports[application_id] }}"
- name: "remove {{ docker_compose_instance_directory }} and all its contents"
file:
path: "{{ docker_compose_instance_directory }}"
state: absent
when: mode_reset | bool
- name: "create {{docker_compose_instance_directory}}"
file:
path: "{{docker_compose_instance_directory}}"
state: directory
mode: 0755
- 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