ansible-role-minio/tasks/main.yml

65 lines
2.6 KiB
YAML
Raw Normal View History

2021-10-27 18:21:52 +02:00
---
2021-11-08 12:23:34 +01:00
- name: Manage the installation of the OpenASFA configuration of the database
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'
run_once: True
when:
- open_asfa_db_docker_host == ansible_fqdn
- open_asfa_db_as_container
tags: [ 'open_asfa', 'open_asfa_swarm', 'open_asfa_db' ]
- name: Manage the installation of the OpenASFA configuration of pgadmin
block:
- name: Create the directory where the pgadmin configuration is going to be installed
file: dest={{ open_asfa_compose_dir }} state=directory
- 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
run_once: True
when: open_asfa_pgadmin_docker_host == ansible_fqdn
tags: [ 'open_asfa', 'open_asfa_swarm', 'open_asfa_db' ]
- name: Manage the installation of the OpenASFA configuration of the swarm service
block:
- name: Add the label that will be used as a constraint for the PostgreSQL DB
docker_node:
hostname: '{{ open_asfa_db_docker_host }}'
labels:
asfa_pg_data: 'asfa_server'
labels_state: 'merge'
when: open_asfa_db_as_container
- name: Add the label that will be used as a constraint for the Pgadmin service
docker_node:
hostname: '{{ open_asfa_pgadmin_docker_host }}'
labels:
asfa_pgadmin_data: 'asfa_server'
labels_state: 'merge'
- 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'
- name: Install the docker compose file for postgresql and pgadmin
template: src=open-asfa-db-docker-compose.yml.j2 dest={{ open_asfa_compose_dir }}/docker-open-asfa-stack-db.yml owner=root group=root mode='0400'
- name: Start the OpenAsfa stack
docker_stack:
name: open-asfa
state: present
compose:
- '{{ open_asfa_compose_dir }}/docker-open-asfa-stack-db.yml'
# - '{{ open_asfa_compose_dir }}/docker-open-asfa-stack.yml'
run_once: True
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
tags: [ 'open_asfa', 'open_asfa_swarm' ]