Skip to content

Commit fc98143

Browse files
Merge pull request #123 from netmanagers/alxwr-master-updates
fix(config): set default_database_type; fixes #118 (supersedes #121)
2 parents 3b71be7 + 6da70d2 commit fc98143

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

postfix/config.sls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% from "postfix/map.jinja" import postfix with context %}
2+
23
include:
34
- postfix
45
@@ -117,7 +118,7 @@ postfix-config-file-managed-{{ domain }}-ssl-key:
117118
{%- elif ':' in file_path %}
118119
{%- set file_type, file_path = file_path.split(':') %}
119120
{%- else %}
120-
{%- set file_type = default_database_type %}
121+
{%- set file_type = postfix.default_database_type %}
121122
{%- endif %}
122123
{%- if not file_path.startswith('/') %}
123124
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}

postfix/defaults.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ postfix:
1313
service: postfix
1414
xbin_prefix: /usr
1515
dovecot_deliver: /usr/lib/dovecot/deliver
16+
default_database_type: hash

postfix/files/main.cf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ policy-spf_time_limit = {{ policyd_spf.get('time_limit', '3600s') }}
118118
{{ set_parameter('smtpd_recipient_restrictions', recipient_restrictions) }}
119119

120120
{# From init.sls #}
121-
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}
122-
123121
{%- for mapping, data in salt['pillar.get']('postfix:mapping', {}).items() %}
124122
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
125123
{%- if file_path.startswith('proxy:') %}
@@ -128,7 +126,7 @@ policy-spf_time_limit = {{ policyd_spf.get('time_limit', '3600s') }}
128126
{%- elif ':' in file_path %}
129127
{%- set file_type, file_path = file_path.split(':') %}
130128
{%- else %}
131-
{%- set file_type = default_database_type %}
129+
{%- set file_type = postfix.default_database_type %}
132130
{%- endif %}
133131
{%- if not file_path.startswith('/') %}
134132
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}

postfix/init.sls

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ postfix-init-service-running-postfix-restart:
4444
- pkg: postfix-init-pkg-installed-postfix
4545
{%- endif %}
4646
47-
{# Used for newaliases, postalias and postconf #}
48-
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}
49-
5047
# manage /etc/aliases if data found in pillar
5148
{% if 'aliases' in pillar.get('postfix', '') %}
5249
{% if salt['pillar.get']('postfix:aliases:use_file', true) == true %}
@@ -55,7 +52,7 @@ postfix-init-service-running-postfix-restart:
5552
{%- if ':' in file_path %}
5653
{%- set file_type, file_path = postfix.aliases_file.split(':') %}
5754
{%- else %}
58-
{%- set file_type = default_database_type %}
55+
{%- set file_type = postfix.default_database_type %}
5956
{%- endif %}
6057
{%- if file_type in ("btree", "cdb", "dbm", "hash", "sdbm") %}
6158
{%- set need_newaliases = True %}

0 commit comments

Comments
 (0)