Add conditional otherwise it fails if there is no

postfix_domains dictionary
This commit is contained in:
phil 2023-03-24 20:21:23 +01:00
parent 28c7f9ca79
commit ee7cc584b6

View file

@ -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 %}