You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/elastic/tasks/main.yaml

92 lines
2.4 KiB
YAML

---
### tags:
### update_certs
### update_config
### update_settings
### update_deployment
### update_ilm_configuration
- name: "Check if {{ elastic_id }}/docker-compose.yml exists"
stat:
path: '{{ service_base_path }}/{{ elastic_id }}/docker-compose.yml'
register: check_docker_compose_file
tags:
- update_config
- update_deployment
- name: "Stop {{ elastic_id }}"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/{{ elastic_id }}'
state: absent
when: check_docker_compose_file.stat.exists
tags:
- update_config
- update_deployment
- name: "Deploy docker templates for {{ elastic_id }}"
include_role:
name: hetzner-ansible-sma-deploy
tasks_from: templates
vars:
current_config: "_docker"
current_base_path: "{{ service_base_path }}"
current_destination: "{{ elastic_id }}"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
current_docker: "{{ elastic_docker }}"
tags:
- update_config
- name: "Deploy service templates for {{ elastic_id }}"
include_role:
name: hetzner-ansible-sma-deploy
tasks_from: templates
vars:
current_config: "elastic"
current_base_path: "{{ service_base_path }}"
current_destination: "{{ elastic_id }}"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
tags:
- update_config
- name: "Deploy certificate templates for {{ elastic_id }}"
include_role:
name: hetzner-ansible-sma-deploy
tasks_from: templates
vars:
current_config: "elastic-certs/{{ stage }}-certs"
current_base_path: "{{ service_base_path }}"
current_destination: "{{ elastic_id }}/certs"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
cleanup_destination: "true"
tags:
- update_certs
- update_config
- name: "Restart {{ elastic_id }}"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/{{ elastic_id }}'
restarted: yes
build: no
tags:
- update_certs
- name: "Update {{ elastic_id }}"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/{{ elastic_id }}'
state: present
pull: yes
tags:
- update_config
- update_deployment
- name: "Update elastic settings"
include_tasks: update_settings.yml
tags:
- update_config
- update_settings
- update_ilm_configuration