ansible-role-inception/tasks/inception.yml

49 lines
2.1 KiB
YAML
Raw Normal View History

2021-11-02 19:47:36 +01:00
---
- name: Manage the installation of the Inception configuration of the swarm service
block:
- name: Create the data directory used by the inception service, and its subdirectories
file: dest={{ inception_project_service_volume }}/{{ item }} state=directory
with_items:
- 'repository/kb'
- 'plugins'
- name: Install the inception properties file
template: src=settings.properties.j2 dest={{ inception_project_service_volume }}/settings.properties owner=root group=root mode='0444'
when: inception_project_docker_data_node == ansible_fqdn
tags: ['inception_project', 'inception_project_swarm', 'inception_project_service']
2021-11-02 19:47:36 +01:00
- name: Manage the installation of the Inception project Docker stack
block:
- name: Create the directory where the compose file will be installed
file: dest={{ inception_project_compose_dir }} state=directory mode='0750' owner=root group=root
- name: Install the docker compose file
template: src=inception-project-docker-compose.yml.j2 dest={{ inception_project_compose_dir }}/docker-inception-project-stack.yml owner=root group=root mode='0400'
- name: Add the label that will be used as a constraint for the inception data volume
docker_node:
hostname: '{{ inception_project_docker_data_node }}'
labels:
service_data: 'inception_project'
labels_state: 'merge'
- name: Add the label that will be used as a constraint for the MySQL DB
docker_node:
hostname: '{{ inception_project_docker_db_node }}'
labels:
mysql_data: 'inception_project'
labels_state: 'merge'
when: inception_project_db_as_container
2022-04-29 14:08:05 +02:00
- name: Start the Inception project stack
2021-11-02 19:47:36 +01:00
docker_stack:
name: inception-project
state: present
compose:
- '{{ inception_project_compose_dir }}/docker-inception-project-stack.yml'
2022-04-29 14:08:05 +02:00
run_once: true
2021-11-02 19:47:36 +01:00
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
tags: ['inception_project', 'inception_project_swarm', 'inception_project_service']