49 lines
1.8 KiB
YAML
49 lines
1.8 KiB
YAML
---
|
|
- name: Manage the compose directory
|
|
tags: ['inception_project', 'inception_project_swarm', 'inception_project_service']
|
|
block:
|
|
- name: Create the directory where the compose file will be installed
|
|
ansible.builtin.file:
|
|
dest: "{{ inception_project_compose_dir }}"
|
|
state: directory mode='0750'
|
|
owner: root
|
|
group: root
|
|
mode: 0700
|
|
|
|
- name: Manage the installation of the Inception configuration of the swarm service
|
|
tags: ['inception_project', 'inception_project_swarm', 'inception_project_service']
|
|
block:
|
|
- name: Install the inception properties file
|
|
ansible.builtin.template:
|
|
src: settings.properties.j2
|
|
dest: "{{ inception_project_compose_dir }}/settings.properties"
|
|
owner: root
|
|
group: root
|
|
mode: 0400
|
|
|
|
- name: Manage the installation of the Inception project Docker stack
|
|
run_once: true
|
|
when: docker_swarm_manager_main_node is defined and docker_swarm_manager_main_node | bool
|
|
tags: ['inception_project', 'inception_project_swarm', 'inception_project_service']
|
|
block:
|
|
- name: Install the docker compose file
|
|
ansible.builtin.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: Create the secret for the application settings
|
|
community.docker.docker_secret:
|
|
name: inception_service_config
|
|
data_src: "{{ inception_project_compose_dir }}/settings.properties"
|
|
state: present
|
|
|
|
- name: Start the Inception project stack
|
|
community.docker.docker_stack:
|
|
name: inception-project
|
|
state: present
|
|
compose:
|
|
- '{{ inception_project_compose_dir }}/docker-inception-project-stack.yml'
|