From ee7cc584b69bff5dad6294cc164ea9ddac3d8fca Mon Sep 17 00:00:00 2001 From: phil Date: Fri, 24 Mar 2023 20:21:23 +0100 Subject: [PATCH] Add conditional otherwise it fails if there is no postfix_domains dictionary --- templates/postfix/conf.d/transport_relay.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/postfix/conf.d/transport_relay.j2 b/templates/postfix/conf.d/transport_relay.j2 index 22349ca..3f6e34d 100644 --- a/templates/postfix/conf.d/transport_relay.j2 +++ b/templates/postfix/conf.d/transport_relay.j2 @@ -1,5 +1,6 @@ ### {{ ansible_managed }} +{% if postfix_domains is defined %} {% for domain in postfix_domains %} {% if domain.type == "relay" %} {% if domain.comment is defined %} @@ -8,3 +9,4 @@ {{ "%-50s %s" | format(domain.name, domain.relay_host) }} {% endif %} {% endfor %} +{% endif %}