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/shared_service/tasks/main.yml

74 lines
2.1 KiB
YAML

---
### tags:
### update_deployment
- name: "Updating DNS for <{{ current_dns_entry }}> to <{{ current_server_ip }}>"
include_role:
name: hetzner-ansible-dns
vars:
record_data: "{{ current_server_ip }}"
record_name: "{{ current_dns_entry }}"
tags:
- update_deployment
- name: "Updating public DNS for <{{ current_host }}>"
include_role:
name: hetzner-ansible-dns
vars:
record_data: "{{ item.ip }}"
record_name: "{{ item.name }}"
loop: "{{ current_dns_entries }}"
tags:
- update_deployment
- name: "Checking if <{{ current_service_id }}/docker-compose.yml> exists"
stat:
path: '{{ service_base_path }}/{{ current_service_id }}/docker-compose.yml'
register: check_docker_compose_file
tags:
- update_deployment
- name: "Stopping <{{ current_service_id }}>"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/{{ current_service_id }}'
state: absent
when: check_docker_compose_file.stat.exists
tags:
- update_deployment
- name: "Deploying docker templates for <{{ current_service_id }}>"
include_role:
name: hetzner-ansible-sma-deploy
tasks_from: templates
vars:
current_config: "_docker"
current_base_path: "{{ service_base_path }}"
current_destination: "{{ current_service_id }}"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
current_docker: "{{ current_service_docker }}"
tags:
- update_deployment
- name: "Deploying service templates for <{{ current_service_id }}>"
include_role:
name: hetzner-ansible-sma-deploy
tasks_from: templates
vars:
current_config: "{{ current_service }}"
current_base_path: "{{ service_base_path }}"
current_destination: "{{ current_service_id }}"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
tags:
- update_deployment
- name: "Starting <{{ current_service_id }}>"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/{{ current_service_id }}'
state: present
pull: true
tags:
- update_deployment