created playbook for prod

This commit is contained in:
dcore94 2021-02-16 12:26:19 +01:00
parent b874434f2d
commit af94edbda4
3 changed files with 55 additions and 2 deletions

View File

@ -28,9 +28,12 @@ Files for swarms and configurations will be generated inside a temporary folder
In order to change destination folder use the switch: `-e target_path=anotherdir`
If you only want to review the generated files run the command `ansible-playbook site.yaml -e dry=true`
In order to switch between postgres and mysql specify the db on the proper variable: `-e db=mysql`
In order to skip worker creation specify the noworker varaible: `-e noworker=true`
In order to connect to an external postgres withouth pulling up a service in the stack use -e db=remote-postgres
In order to skip worker creation specify the noworker variable: `-e noworker=true`
In order to enable the cluster replacement use the switch: `-e cluster_replacement=true`
If you run the stack in production behind a load balenced setup ensure the variable cluster_check is true: `ansible-playbook site.yaml -e cluster_check=true`
If you run the stack in production behind a load balanced setup ensure the variable cluster_check is true: `ansible-playbook site.yaml -e cluster_check=true`
In order to avoid confusion of all variables a proper site.yaml has been created for prod environment. Run `ansible-playbook site-prod.yaml` and this should deploy a stack with prod setup.
Other setting can be fine tuned by checking the variables in the proper roles which are:

View File

@ -0,0 +1,9 @@
---
use_jdbc: True
postgres_host: "postgresql-srv.d4science.org"
conductor_db: "postgres"
jdbc_user: "conductor_u"
jdbc_pass: "c36dda661add7c2b5093087ddb655992"
jdbc_db: "conductor"
jdbc_url: "jdbc:postgresql://{{ postgres_host }}:5432/{{ jdbc_db }}"

41
site-prod.yaml Normal file
View File

@ -0,0 +1,41 @@
---
- hosts: localhost
vars:
cluster_check: true
conductor_workers_server: http://conductor-server:8080/api
roles:
- common
- external-postgres
- elasticsearch
- cluster-replacement
- conductor
- workers
tasks:
- name: Start es
docker_stack:
name: conductor-prod
state: present
compose:
- "{{ target_path }}/elasticsearch-swarm.yaml"
when: dry is not defined or not dry|bool
- name: Waiting for databases
pause:
seconds: 5
when: dry is not defined or not dry|bool
- name: Start conductor
docker_stack:
name: conductor-prod
state: present
compose:
- "{{ target_path }}/conductor-swarm.yaml"
when: dry is not defined or not dry|bool
- name: Start workers
docker_stack:
name: conductor-prod
state: present
compose:
- "{{ target_path }}/conductor-workers-swarm.yaml"
when: dry is not defined or not dry|bool