29 lines
1.1 KiB
Django/Jinja
29 lines
1.1 KiB
Django/Jinja
{% macro default_network(subnet_index) %}
|
|
default:
|
|
enable_ipv6: true
|
|
ipam:
|
|
config:
|
|
- subnet: {{ docker_ipv6_subnet | ansible.utils.ipsubnet(80, subnet_index) }}
|
|
{% endmacro %}
|
|
|
|
{% macro traefik_labels(host, service="", port="", auth=false) %}
|
|
traefik.enable=true
|
|
- traefik.http.routers.{{ host }}.rule=Host(`{{ host }}.{{ domain }}`)
|
|
- traefik.http.routers.{{ host }}.entrypoints=web
|
|
- traefik.http.routers.{{ host }}-tls.rule=Host(`{{ host }}.{{ domain }}`)
|
|
- traefik.http.routers.{{ host }}-tls.entrypoints=websecure
|
|
- traefik.http.routers.{{ host }}-tls.tls=true
|
|
- traefik.http.routers.{{ host }}-tls.tls.certresolver=letsencrypt
|
|
- traefik.http.routers.{{ host }}-tls.tls.domains.0.main={{ domain }}
|
|
- traefik.http.routers.{{ host }}-tls.tls.domains.0.sans=*.{{ domain }}
|
|
{% if service -%}
|
|
- traefik.http.routers.{{ host }}.service={{ service }}
|
|
{% endif %}
|
|
{% if port -%}
|
|
- traefik.http.services.{{ host }}.loadbalancer.server.port={{ port }}
|
|
{% endif %}
|
|
{% if auth -%}
|
|
- traefik.http.routers.{{ host }}-tls.middlewares=authentik@docker
|
|
{% endif %}
|
|
{% endmacro %}
|