2021-03-09 14:16:57 +01:00
|
|
|
---
|
2021-03-09 15:05:22 +01:00
|
|
|
- name: Manage the installation of the OpenASFA configuration of the swarm service
|
|
|
|
block:
|
|
|
|
- name: Create the directory where the DB init script is going to be installed
|
|
|
|
file: dest={{ open_asfa_compose_dir }} state=directory
|
|
|
|
|
|
|
|
- name: Install the DB initialization script
|
|
|
|
template: src=pg-create-user-db.sh.j2 dest={{ open_asfa_compose_dir }}/pg-create-user-db.sh owner=root group=root mode='0555'
|
|
|
|
|
2021-03-15 18:49:28 +01:00
|
|
|
- name: Install the pgadmin configuration files
|
|
|
|
template: src={{ item }}.j2 dest={{ open_asfa_compose_dir }}/{{ item }} owner=root group=root mode='0444'
|
|
|
|
loop:
|
|
|
|
- pgadmin_config_local.py
|
|
|
|
- pgadmin_servers.json
|
|
|
|
|
2021-03-09 15:05:22 +01:00
|
|
|
run_once: True
|
|
|
|
when:
|
2021-03-09 15:40:18 +01:00
|
|
|
- open_asfa_db_docker_host == ansible_fqdn
|
2021-03-09 15:05:22 +01:00
|
|
|
- open_asfa_db_as_container
|
|
|
|
tags: [ 'open_asfa', 'open_asfa_swarm', 'open_asfa_db' ]
|
|
|
|
|
|
|
|
- name: Manage the installation of the OpenASFA configuration of the swarm service
|
|
|
|
block:
|
2021-03-09 15:40:18 +01:00
|
|
|
- name: Add the label that will be used as a constraint for the PostgreSQL DB
|
|
|
|
docker_node:
|
|
|
|
hostname: '{{ open_asfa_db_docker_host }}'
|
|
|
|
#node.labels.pg_data==asfa_server_test
|
|
|
|
labels:
|
2021-04-16 13:30:58 +02:00
|
|
|
pg_data_asfa_test: 'asfa_server_test'
|
|
|
|
pgadmin_data_asfa_test: 'asfa_server_test'
|
2021-03-09 15:40:18 +01:00
|
|
|
labels_state: 'merge'
|
|
|
|
when: open_asfa_db_as_container
|
|
|
|
|
2021-04-16 13:30:58 +02:00
|
|
|
- name: Install the docker compose file for postgresql and pgadmin
|
2021-03-15 18:49:28 +01:00
|
|
|
template: src=open-asfa-db-docker-compose.yml.j2 dest={{ open_asfa_compose_dir }}/docker-open-asfa-stack-db-test.yml owner=root group=root mode='0400'
|
|
|
|
when: open_asfa_db_as_container
|
|
|
|
|
2022-12-02 14:59:47 +01:00
|
|
|
- name: Install the docker compose file of Couchbase
|
|
|
|
template: src=open-asfa-couchbase-docker-compose.yml.j2 dest={{ open_asfa_compose_dir }}/docker-open-asfa-stack-couchbase-test.yml owner=root group=root mode='0400'
|
|
|
|
when: open_asfa_db_as_container
|
|
|
|
|
|
|
|
- name: Install the docker compose file of the open-asfa service
|
2021-03-09 15:40:18 +01:00
|
|
|
template: src=open-asfa-docker-compose.yml.j2 dest={{ open_asfa_compose_dir }}/docker-open-asfa-stack-test.yml owner=root group=root mode='0400'
|
2021-03-09 15:05:22 +01:00
|
|
|
|
2021-03-09 15:40:18 +01:00
|
|
|
- name: Start the OpenAsfa stack
|
2021-03-09 15:05:22 +01:00
|
|
|
docker_stack:
|
2021-03-09 15:40:18 +01:00
|
|
|
name: open-asfa-test
|
2021-03-09 15:05:22 +01:00
|
|
|
state: present
|
|
|
|
compose:
|
2021-03-15 18:49:28 +01:00
|
|
|
- '{{ open_asfa_compose_dir }}/docker-open-asfa-stack-db-test.yml'
|
2021-03-09 15:40:18 +01:00
|
|
|
- '{{ open_asfa_compose_dir }}/docker-open-asfa-stack-test.yml'
|
2022-12-02 14:59:47 +01:00
|
|
|
- '{{ open_asfa_compose_dir }}/docker-open-asfa-stack-couchbase-test.yml'
|
2021-03-09 15:05:22 +01:00
|
|
|
|
|
|
|
run_once: True
|
|
|
|
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
|
|
|
|
tags: [ 'open_asfa', 'open_asfa_swarm' ]
|