ansible-playbook-gcore-enab.../roles/vremodeler/tasks/main.yml

95 lines
2.7 KiB
YAML

---
# tasks file for vremodeler
- name: Create the directory where the compose file will be installed
ansible.builtin.file:
dest: '{{ vremodeler_compose_dir }}'
state: directory
mode: 0750
owner: root
group: root
- name: Install the docker compose file
ansible.builtin.template:
src: docker-compose.yml.j2
dest: '{{ vremodeler_compose_dir }}/vremodeler-docker-compose.yml'
owner: root
group: root
mode: 0400
- name: Install the GHNConfig.xml
ansible.builtin.template:
src: GHNConfig.xml.j2
dest: "{{ vremodeler_compose_dir }}/GHNConfig.xml"
owner: root
group: root
mode: 0400
- name: Install the server-config.wsdd
ansible.builtin.template:
src: server-config.wsdd.j2
dest: "{{ vremodeler_compose_dir }}/server-config.wsdd"
owner: root
group: root
mode: 0400
- name: Create the secret for GHNConfig.xml
community.docker.docker_secret:
name: "{{ service_prefix }}-ghn-config-{{ scope_name }}"
data_src: '{{ vremodeler_compose_dir }}/GHNConfig.xml'
state: present
- name: Create the secret for server-config.wsdd
community.docker.docker_secret:
name: "{{ service_prefix }}-server-config-{{ scope_name }}"
data_src: '{{ vremodeler_compose_dir }}/server-config.wsdd'
state: present
- name: Install the gcube keys
get_url: url={{ item.url }} dest={{ vremodeler_compose_dir }}/{{ item.name }} owner=root group=root mode=0600
with_items: "{{ gcube_security_keys }}"
- name: Create the the gcube keys
community.docker.docker_secret:
name: "{{ item.name }}"
data_src: '{{ vremodeler_compose_dir }}/{{ item.name }}'
state: present
with_items: "{{ gcube_security_keys }}"
- name: Install the legacy gcube key
get_url: url={{ item.url }} dest={{ vremodeler_compose_dir }}/{{ item.name }} owner=root group=root mode=0600
with_items: "{{ gcube_security_key_legacy }}"
- name: Create the legacy gcube keys
community.docker.docker_secret:
name: gcube-legacy-security-key
data_src: '{{ vremodeler_compose_dir }}/{{ item.name }}'
state: present
with_items: "{{ gcube_security_key_legacy }}"
- name: Start the project stack on Docker Swarm
community.docker.docker_stack:
name: '{{ vremodeler_docker_stack_name }}'
state: present
compose:
- '{{ vremodeler_compose_dir }}/vremodeler-docker-compose.yml'
register: result
tags:
- deploy
- name: Print info on stack
ansible.builtin.debug:
msg: "{{ result.stdout }}"
tags:
- deploy
- name: Print URL to portainer
ansible.builtin.debug:
msg: |
You can access the stack at:
https://portainer.cloud.d4science.org/#!/1/docker/stacks/{{ vremodeler_docker_stack_name }}?type=1&regular=false&external=true&orphaned=false"
tags:
- deploy