• 1 Post
  • 12 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle







  • I actually need more than merging. For example, right now my traefik.template will look like this:

    [http.routers.{{ router_name }}]
      rule = "{{ router_rule }}"
      service = "{{ service_name }}"
      middlewares = [{{ middlewares | map("tojson") | join(", ") }}]
    {% block router %}{% endblock %}
      [http.routers.{{ router_name }}.tls]
        certResolver = "leresolver_http"
    
    {% if service_host is defined %}
    [[http.services.{{ service_name }}.loadBalancer.servers]]
      url = "{{ 'https' if service_use_https is defined else 'http' }}://{{ service_host }}{{ ':' ~ service_port if service_port is defined else '' }}"
    {% endif %}
    

    and then one of my traefik.toml could look like this

    {% extends "template/traefik.jinja" %}
    
    {% set router_name = "dozzle" %}
    {% set router_rule = "Host(`dozzle.example.com`)" %}
    {% set service_name = "dozzle" %}
    {% set service_host = "dozzle" %}
    {% set service_port = 8080 %}