mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-02-23 04:49:40 +01:00
34 lines
1.3 KiB
YAML
34 lines
1.3 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 domain
|
|
|
|
- name: "Set global http_port to {{ ports.localhost.http_ports[application_id] }}"
|
|
set_fact:
|
|
http_port: "{{ ports.localhost.http_ports[application_id] if application_id in ports.localhost.http_ports else None }}"
|
|
# Default case: One port exists. Some applications like matrix don't have an default port
|
|
|
|
- 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 |