conductor-setup/site-pre.yaml

47 lines
1.3 KiB
YAML
Raw Normal View History

---
- hosts: pre_infra
vars_files:
- roles/external-postgres/defaults/vault_main.yaml
2021-03-24 17:26:49 +01:00
- roles/workers/defaults/smtp.yaml
vars:
cluster_check: true
infrastructure: pre
2021-03-24 17:26:49 +01:00
pymail_password: "{{ smtp_pre_pwd }}"
conductor_workers_server: http://conductor-server:8080/api
roles:
- common
- databases
- cluster-replacement
- conductor
- workers
tasks:
- name: Start {{ db|default('postgres', true) }} and es
docker_stack:
name: 'conductor-{{ infrastructure }}'
state: present
compose:
- "{{ target_path }}/{{ db|default('postgres', true) }}-swarm.yaml"
- "{{ target_path }}/elasticsearch-swarm.yaml"
when: dry is not defined or not dry|bool
- name: Waiting for databases
pause:
seconds: 20
when: dry is not defined or not dry|bool
- name: Start conductor
docker_stack:
name: "conductor-{{ infrastructure }}"
state: present
compose:
- "{{ target_path }}/conductor-swarm.yaml"
when: dry is not defined or not dry|bool
- name: Start workers
docker_stack:
name: "conductor-{{ infrastructure }}"
state: present
compose:
- "{{ target_path }}/conductor-workers-swarm.yaml"
when: dry is not defined or not dry|bool