diff --git a/defaults/main.yml b/defaults/main.yml index 9c76227..ff7fe41 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -26,6 +26,7 @@ mailserver: srs_domain: "srs.{{ inventory_hostname }}" dovecot: debug: false + config: {} postfixadmin: php_fpm_config: user: postfixadmin diff --git a/templates/dovecot/dovecot.conf.j2 b/templates/dovecot/dovecot.conf.j2 index 7963d1c..43bc089 100644 --- a/templates/dovecot/dovecot.conf.j2 +++ b/templates/dovecot/dovecot.conf.j2 @@ -158,3 +158,16 @@ auth_verbose = yes auth_debug = yes mail_debug = yes {% endif %} + +{% macro config_items(obj) %} +{% for key, value in obj.items() %} +{% if value is mapping %} +{{ key }} { +{{ config_items(value)|indent(first=true) }} +} +{% else %} +{{ key }} = {{ value }} +{% endif %} +{% endfor %} +{% endmacro %} +{{ config_items(mailserver.dovecot.config) }}