Run postmap on a specific set of file types

According to postfix documentation [1], only some types of file require running
postmap, others must be left alone.

See github issue #50.

[1] http://www.postfix.org/postmap.1.html
This commit is contained in:
Gilles Dartiguelongue 2016-12-29 11:33:44 +01:00
parent d75184a7d1
commit 7ce8798709
1 changed files with 4 additions and 2 deletions

View File

@ -37,8 +37,10 @@ run-newaliases:
{%- set need_postmap = False %}
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
{%- if ':' in file_path %}
{%- set file_path = file_path.split(':')[1] %}
{%- set need_postmap = True %}
{%- set file_type, file_path = file_path.split(':') %}
{%- if file_type in ("btree", "cdb", "dbm", "hash", "sdbm") %}
{%- set need_postmap = True %}
{%- endif %}
{%- endif %}
postfix_{{ mapping }}:
file.managed: