2020-10-13 16:49:18 +02:00
|
|
|
---
|
2020-10-13 18:33:16 +02:00
|
|
|
- name: Manage the installation of the OpenASFA configuration of the swarm service
|
|
|
|
block:
|
2020-10-14 14:03:30 +02:00
|
|
|
- name: Create the directory where the DB init script is going to be installed
|
2020-10-13 19:26:55 +02:00
|
|
|
file: dest={{ open_asfa_compose_dir }} state=directory
|
2020-10-13 18:33:16 +02:00
|
|
|
|
2020-10-14 13:58:10 +02:00
|
|
|
- name: Install the DB initialization script
|
2020-10-14 15:05:44 +02:00
|
|
|
template: src=pg-create-user-db.sh.j2 dest={{ open_asfa_compose_dir }}/pg-create-user-db.sh owner=root group=root mode='0555'
|
2020-10-14 13:58:10 +02:00
|
|
|
|
|
|
|
run_once: True
|
|
|
|
when: open_asfa_docker_db_node is defined and open_asfa_docker_db_node
|
|
|
|
tags: [ 'open_asfa', 'open_asfa_swarm', 'open_asfa_db' ]
|
|
|
|
|
|
|
|
- name: Manage the installation of the OpenASFA configuration of the swarm service
|
|
|
|
block:
|
2020-10-13 19:26:55 +02:00
|
|
|
- name: Install the docker compose file
|
|
|
|
template: src=open-asfa-docker-compose.yml.j2 dest={{ open_asfa_compose_dir }}/docker-open-asfa-stack.yml owner=root group=root mode='0400'
|
2020-10-13 18:33:16 +02:00
|
|
|
|
2020-10-13 19:26:55 +02:00
|
|
|
- name: Start the OpenAsfa stack
|
|
|
|
docker_stack:
|
|
|
|
name: open-asfa
|
|
|
|
state: present
|
|
|
|
compose:
|
|
|
|
- '{{ open_asfa_compose_dir }}/docker-open-asfa-stack.yml'
|
2020-10-13 18:33:16 +02:00
|
|
|
|
2020-10-13 19:26:55 +02:00
|
|
|
- name: Connect the OpenASFA service to the haproxy-public network
|
|
|
|
command: docker service update --network-add {{ open_asfa_haproxy_public_net }} {{ open_asfa_docker_service_name }}_{{ open_asfa_docker_service_server_name }} --update-delay 30s --update-parallelism 1
|
|
|
|
ignore_errors: True
|
|
|
|
when: open_asfa_behind_haproxy
|
2020-10-13 18:33:16 +02:00
|
|
|
|
|
|
|
run_once: True
|
2020-10-13 19:26:55 +02:00
|
|
|
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
|
|
|
|
tags: [ 'open_asfa', 'open_asfa_swarm' ]
|