You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
conductor-setup/site.yaml

56 lines
1.4 KiB
YAML

---
- hosts: localhost
roles:
- common
- role: cluster-replacement
when:
- cluster_replacement is defined and cluster_replacement|bool
- role: postgres
when: db is not defined or db == 'postgres'
- role: mysql
when: db is defined and db == 'mysql'
- elasticsearch
- conductor
tasks:
- name: Start {{ db|default('postgres', true) }} and es
docker_stack:
name: conductor
state: present
compose:
- "{{ target_path }}/{{ db|default('postgres', true) }}-swarm.yaml"
- "{{ target_path }}/elasticsearch-swarm.yaml"
when: dry is not defined or dry|bool
- name: Waiting for databases
pause:
seconds: 10
when: dry is not defined or dry|bool
- name: Start conductor
docker_stack:
name: conductor
state: present
compose:
- "{{ target_path }}/conductor-swarm.yaml"
when: dry is not defined or dry|bool
- name: Start haproxy
docker_stack:
name: conductor
state: present
compose:
- "{{ target_path }}/haproxy-swarm.yaml"
when:
- dry is not defined or dry|bool
- cluster_replacement is defined
- cluster_replacement|bool
- name: Start workers
include_role:
name: workers
when:
- dry is not defined or dry|bool
- workers is defined
- workers|bool