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

55 lines
1.4 KiB
YAML

---
### tags:
- name: "Check if traefik/docker-compose.yml exists"
stat:
path: '{{ service_base_path }}/traefik/docker-compose.yml'
register: check_docker_compose_file
- name: "Stop traefik"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/traefik'
state: absent
when: check_docker_compose_file.stat.exists
- name: "Deploy docker templates for traefik"
include_role:
name: sma_deploy
tasks_from: templates
vars:
current_config: "_docker"
current_base_path: "{{ service_base_path }}"
current_destination: "traefik"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
current_docker: "{{ traefik_docker }}"
- name: "Deploy service templates for traefik"
include_role:
name: sma_deploy
tasks_from: templates
vars:
current_config: "traefik"
current_base_path: "{{ service_base_path }}"
current_destination: "traefik"
current_owner: "{{ docker_owner }}"
current_group: "{{ docker_group }}"
- name: "Ensure acme.json exists"
copy:
content: ""
dest: '{{ service_base_path }}/traefik/acme.json'
force: no
owner: "{{ docker_owner }}"
group: "{{ docker_group }}"
mode: '0600'
- name: "Update traefik"
community.docker.docker_compose:
project_src: '{{ service_base_path }}/traefik'
state: present
pull: yes
tags:
- update_deployment