Element traefik support probably

This commit is contained in:
uumas
2022-01-08 02:04:42 +02:00
parent 6d3e84e1d4
commit 4ce2ca74f4
2 changed files with 17 additions and 2 deletions

View File

@@ -1,5 +1,14 @@
--- ---
- name: Set element published ports variable
set_fact:
element_published_ports: ["127.0.0.1:{{ ports.element_http }}:80"]
when: reverse_proxy_type != 'traefik'
- name: Include traefik vars
include_vars: traefik.yml
when: reverse_proxy_type == 'traefik'
- name: Element web - name: Element web
docker_container: docker_container:
name: 'element' name: 'element'
@@ -8,8 +17,8 @@
container_default_behavior: no_defaults container_default_behavior: no_defaults
volumes: volumes:
- /app - /app
published_ports: published_ports: "{{ element_published_ports | default(omit) }}"
- "127.0.0.1:{{ ports.element_http }}:80" labels: "{{ element_traefik_labels | default(omit) }}"
restart_policy: always restart_policy: always
register: element_out register: element_out

View File

@@ -0,0 +1,6 @@
---
element_traefik_labels:
traefik.enable: 'true'
traefik.http.routers.element.rule: "Host(`{{ element_domains | join('`) || Host(`') }}`)"
traefik.http.routers.element.tls.certresolver: 'le'