Let the user handle mappings manually

This commit is contained in:
Alexander Weidinger 2017-12-08 14:53:58 +01:00
parent caee184158
commit 014c5227bc
1 changed files with 8 additions and 0 deletions

View File

@ -1,11 +1,18 @@
{%- from "postfix/map.jinja" import postfix with context -%} {%- from "postfix/map.jinja" import postfix with context -%}
{%- set config = salt['pillar.get']('postfix:config', {}) -%} {%- set config = salt['pillar.get']('postfix:config', {}) -%}
{%- if not salt['pillar.get']('postfix:mapping', False) %}
{#- Let the user configure mapping manually. -#}
{%- set processed_parameters = [] %}
{%- else -%}
{#- TODO: alias_maps probably belongs here, too: #} {#- TODO: alias_maps probably belongs here, too: #}
{%- set processed_parameters = [ {%- set processed_parameters = [
'virtual_alias_maps', 'virtual_alias_maps',
'smtp_sasl_password_maps', 'smtp_sasl_password_maps',
'sender_canonical_maps', 'sender_canonical_maps',
] %} ] %}
{%- endif -%}
{%- macro set_parameter(parameter, default=None) -%} {%- macro set_parameter(parameter, default=None) -%}
{% set value = config.get(parameter, default) %} {% set value = config.get(parameter, default) %}
{%- if value is not none %} {%- if value is not none %}
@ -17,6 +24,7 @@
{%- do processed_parameters.append(parameter) %} {%- do processed_parameters.append(parameter) %}
{%- endif %} {%- endif %}
{%- endmacro -%} {%- endmacro -%}
# Managed by config management # Managed by config management
# See /usr/share/postfix/main.cf.dist for a commented, more complete version # See /usr/share/postfix/main.cf.dist for a commented, more complete version