From 6d4ba2caeaa501189b26f43e48ba59db4dc0d37a Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 24 Mar 2023 19:40:10 +0100 Subject: [PATCH] WIP: Test creation of relay domains --- templates/postfix/conf.d/transport_relay.j2 | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) 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 %}