Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

53 lines
2.8 KiB

  1. {% if matrix_bot_honoroit_container_labels_traefik_enabled %}
  2. traefik.enable=true
  3. {% if matrix_bot_honoroit_container_labels_traefik_docker_network %}
  4. traefik.docker.network={{ matrix_bot_honoroit_container_labels_traefik_docker_network }}
  5. {% endif %}
  6. traefik.http.services.matrix-bot-honoroit-metrics.loadbalancer.server.port=8080
  7. {% set middlewares = [] %}
  8. {% set middlewares_metrics = [] %}
  9. {% if matrix_bot_honoroit_container_labels_traefik_path_prefix != '/' %}
  10. traefik.http.middlewares.matrix-bot-honoroit-slashless-redirect.redirectregex.regex=({{ matrix_bot_honoroit_container_labels_traefik_path_prefix | quote }})$
  11. traefik.http.middlewares.matrix-bot-honoroit-slashless-redirect.redirectregex.replacement=${1}/
  12. {% set middlewares = middlewares + ['matrix-bot-honoroit-slashless-redirect'] %}
  13. {% endif %}
  14. {% if matrix_bot_honoroit_container_labels_traefik_path_prefix != '/' %}
  15. traefik.http.middlewares.matrix-bot-honoroit-strip-prefix.stripprefix.prefixes={{ matrix_bot_honoroit_container_labels_traefik_path_prefix }}
  16. {% set middlewares = middlewares + ['matrix-bot-honoroit-strip-prefix'] %}
  17. {% endif %}
  18. {% if matrix_bot_honoroit_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
  19. {% for name, value in matrix_bot_honoroit_container_labels_traefik_additional_response_headers.items() %}
  20. traefik.http.middlewares.matrix-bot-honoroit-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
  21. {% endfor %}
  22. {% set middlewares = middlewares + ['matrix-bot-honoroit-add-headers'] %}
  23. {% endif %}
  24. {% if matrix_bot_honoroit_basicauth_enabled %}
  25. traefik.http.middlewares.matrix-bot-honoroit-auth.basicauth.users={{ lookup('ansible.builtin.file', matrix_bot_honoroit_basicauth_file) }}
  26. {% set middlewares_metrics = middlewares + ['matrix-bot-honoroit-auth'] %}
  27. {% endif %}
  28. {% if middlewares_metrics | length > 0 %}
  29. traefik.http.routers.matrix-bot-honoroit-metrics.rule={{ matrix_bot_honoroit_container_labels_traefik_metrics_rule }}
  30. {% if matrix_bot_honoroit_container_labels_traefik_priority | int > 0 %}
  31. traefik.http.routers.matrix-bot-honoroit-metrics.priority={{ matrix_bot_honoroit_container_labels_traefik_priority }}
  32. {% endif %}
  33. traefik.http.routers.matrix-bot-honoroit-metrics.service=matrix-bot-honoroit-metrics
  34. traefik.http.routers.matrix-bot-honoroit-metrics.middlewares={{ middlewares_metrics | join(',') }}
  35. traefik.http.routers.matrix-bot-honoroit-metrics.entrypoints={{ matrix_bot_honoroit_container_labels_traefik_entrypoints }}
  36. traefik.http.routers.matrix-bot-honoroit-metrics.tls={{ matrix_bot_honoroit_container_labels_traefik_tls | to_json }}
  37. {% if matrix_bot_honoroit_container_labels_traefik_tls %}
  38. traefik.http.routers.matrix-bot-honoroit-metrics.tls.certResolver={{ matrix_bot_honoroit_container_labels_traefik_tls_certResolver }}
  39. {% endif %}
  40. {% endif %}
  41. {% endif %}
  42. {{ matrix_bot_honoroit_container_labels_additional_labels }}