feat: deployable playbook
This commit is contained in:
parent
f8e1de4f0a
commit
7ab2b719dc
23 changed files with 754 additions and 176 deletions
41
roles/traefik/templates/docker-compose.yml.j2
Normal file
41
roles/traefik/templates/docker-compose.yml.j2
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: traefik
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: "{{ traefik_image }}"
|
||||
container_name: traefik
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- "{{ traefik_config_dir }}/traefik.yml:/etc/traefik/traefik.yml:ro"
|
||||
- "{{ traefik_data_dir }}:/data"
|
||||
{% if traefik_custom_ca_enabled | default(false) %}
|
||||
- "{{ traefik_custom_ca_path }}:/etc/ssl/certs/custom-ca.pem:ro"
|
||||
{% endif %}
|
||||
networks:
|
||||
{% for network in traefik_networks %}
|
||||
- "{{ network.name }}"
|
||||
{% endfor %}
|
||||
{% if traefik_custom_ca_enabled | default(false) %}
|
||||
environment:
|
||||
- LEGO_CA_CERTIFICATES=/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/custom-ca.pem
|
||||
{% endif %}
|
||||
command:
|
||||
- --configfile=/etc/traefik/traefik.yml
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.{{ traefik_domain | default('localhost') }}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
||||
- "traefik.http.routers.traefik-dashboard.service=api@internal"
|
||||
|
||||
networks:
|
||||
{% for network in traefik_networks %}
|
||||
{{ network.name }}:
|
||||
{% if network.external | default(false) %}
|
||||
external: true
|
||||
{% else %}
|
||||
driver: bridge
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue