summaryrefslogtreecommitdiffstats
path: root/roles/common
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2017-01-14 19:33:20 +0100
committerGuilhem Moulin <guilhem@fripost.org>2017-01-14 19:33:20 +0100
commit9f865f8cd33231c0dd7786faa2dec468e295f0fd (patch)
tree451db2011d3f06d20da4dac132c54eb35dee1aea /roles/common
parentce7a5c2790e1148da82099000440155d2faeb1d0 (diff)
Fix Ansible 2.2.0 compatibility of a Jinja2 template.
Diffstat (limited to 'roles/common')
-rw-r--r--roles/common/templates/etc/postfix/main.cf.j213
1 files changed, 4 insertions, 9 deletions
diff --git a/roles/common/templates/etc/postfix/main.cf.j2 b/roles/common/templates/etc/postfix/main.cf.j2
index 8caaa82..af909ba 100644
--- a/roles/common/templates/etc/postfix/main.cf.j2
+++ b/roles/common/templates/etc/postfix/main.cf.j2
@@ -36,17 +36,12 @@ relay_domains =
smtp_tls_security_level = none
smtpd_tls_security_level = none
-{% set multi_instance = False %}
-{%- for g in postfix_instance.keys() | sort -%}
- {%- if g in group_names -%}
- {%- if not multi_instance -%}
- {%- set multi_instance = True -%}
+{% set instances = postfix_instance.keys() | intersect(group_names) | list %}
+{%- if instances | length > 0 -%}
## Other postfix instances
multi_instance_wrapper = $command_directory/postmulti -p --
multi_instance_enable = yes
-multi_instance_directories =
- {%- endif %} /etc/postfix-{{ postfix_instance[g].name }}
- {%- endif %}
-{% endfor %}
+multi_instance_directories ={% for i in instances | sort %} /etc/postfix-{{ postfix_instance[i].name }}{% endfor %}
+{% endif %}
# vim: set filetype=pfmain :