diff --git a/templates/postfix/conf.d/transport_relay.j2 b/templates/postfix/conf.d/transport_relay.j2 index 635d643..8bae9de 100644 --- a/templates/postfix/conf.d/transport_relay.j2 +++ b/templates/postfix/conf.d/transport_relay.j2 @@ -1,10 +1,20 @@ ### {{ ansible_managed }} -{% if postfix_transport_relay is defined %} -{% for transport in postfix_transport_relay %} -{% if transport.comment is defined %} -{{ transport.comment }} +#{% if for domains postfix_transport_relay is defined %} +#{% for transport in postfix_transport_relay %} +#{% if transport.comment is defined %} +#{{ transport.comment }} +#{% endif %} +#{{ "%-50s %s" | format(transport.destination, transport.relay) }} +#{% endfor %} +#{% endif %} + + +{% for domain in posfix_domains %} +{% if domain.type == "relay" %} +{% if domain.comment is defined %} + comment: {{ domain.comment }} +{% endif %} +{{ "%-50s %s" | format(domain.name, domain.relay_host) }} {% endif %} -{{ "%-50s %s" | format(transport.destination, transport.relay) }} {% endfor %} -{% endif %}