{%- from "__haproxy.jinja2" import frontend, backend, usebackend, servers -%}

{% for wrapper_frontend in wrapper_frontends %}
{% call frontend(wrapper_frontend.balancer_name, wrapper_frontend.port, wrapper_frontend.mode, wrapper_frontend.pems) -%}
{{ usebackend(*wrapper_frontend.domains) }}
{%- endcall %}
{%- endfor -%}

{% for wrapper_backend in wrapper_backends %}
{% call backend(wrapper_backend.name, wrapper_backend.mode) -%}
{{ servers(wrapper_backend.name, *wrapper_backend.backends) }}
{%- endcall %}
{%- endfor %}
