Merge pull request #123 from netmanagers/alxwr-master-updates
fix(config): set default_database_type; fixes #118 (supersedes #121)
This commit is contained in:
commit
fc98143c96
@ -1,4 +1,5 @@
|
|||||||
{% from "postfix/map.jinja" import postfix with context %}
|
{% from "postfix/map.jinja" import postfix with context %}
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- postfix
|
- postfix
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ postfix-config-file-managed-{{ domain }}-ssl-key:
|
|||||||
{%- elif ':' in file_path %}
|
{%- elif ':' in file_path %}
|
||||||
{%- set file_type, file_path = file_path.split(':') %}
|
{%- set file_type, file_path = file_path.split(':') %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set file_type = default_database_type %}
|
{%- set file_type = postfix.default_database_type %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if not file_path.startswith('/') %}
|
{%- if not file_path.startswith('/') %}
|
||||||
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}
|
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}
|
||||||
|
@ -13,3 +13,4 @@ postfix:
|
|||||||
service: postfix
|
service: postfix
|
||||||
xbin_prefix: /usr
|
xbin_prefix: /usr
|
||||||
dovecot_deliver: /usr/lib/dovecot/deliver
|
dovecot_deliver: /usr/lib/dovecot/deliver
|
||||||
|
default_database_type: hash
|
||||||
|
@ -118,8 +118,6 @@ policy-spf_time_limit = {{ policyd_spf.get('time_limit', '3600s') }}
|
|||||||
{{ set_parameter('smtpd_recipient_restrictions', recipient_restrictions) }}
|
{{ set_parameter('smtpd_recipient_restrictions', recipient_restrictions) }}
|
||||||
|
|
||||||
{# From init.sls #}
|
{# From init.sls #}
|
||||||
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}
|
|
||||||
|
|
||||||
{%- for mapping, data in salt['pillar.get']('postfix:mapping', {}).items() %}
|
{%- for mapping, data in salt['pillar.get']('postfix:mapping', {}).items() %}
|
||||||
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
|
{%- set file_path = salt['pillar.get']('postfix:config:' ~ mapping) %}
|
||||||
{%- if file_path.startswith('proxy:') %}
|
{%- if file_path.startswith('proxy:') %}
|
||||||
@ -128,7 +126,7 @@ policy-spf_time_limit = {{ policyd_spf.get('time_limit', '3600s') }}
|
|||||||
{%- elif ':' in file_path %}
|
{%- elif ':' in file_path %}
|
||||||
{%- set file_type, file_path = file_path.split(':') %}
|
{%- set file_type, file_path = file_path.split(':') %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set file_type = default_database_type %}
|
{%- set file_type = postfix.default_database_type %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if not file_path.startswith('/') %}
|
{%- if not file_path.startswith('/') %}
|
||||||
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}
|
{%- set file_path = postfix.config_path ~ '/' ~ file_path %}
|
||||||
|
@ -44,9 +44,6 @@ postfix-init-service-running-postfix-restart:
|
|||||||
- pkg: postfix-init-pkg-installed-postfix
|
- pkg: postfix-init-pkg-installed-postfix
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{# Used for newaliases, postalias and postconf #}
|
|
||||||
{%- set default_database_type = salt['pillar.get']('postfix:config:default_database_type', 'hash') %}
|
|
||||||
|
|
||||||
# manage /etc/aliases if data found in pillar
|
# manage /etc/aliases if data found in pillar
|
||||||
{% if 'aliases' in pillar.get('postfix', '') %}
|
{% if 'aliases' in pillar.get('postfix', '') %}
|
||||||
{% if salt['pillar.get']('postfix:aliases:use_file', true) == true %}
|
{% if salt['pillar.get']('postfix:aliases:use_file', true) == true %}
|
||||||
@ -55,7 +52,7 @@ postfix-init-service-running-postfix-restart:
|
|||||||
{%- if ':' in file_path %}
|
{%- if ':' in file_path %}
|
||||||
{%- set file_type, file_path = postfix.aliases_file.split(':') %}
|
{%- set file_type, file_path = postfix.aliases_file.split(':') %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- set file_type = default_database_type %}
|
{%- set file_type = postfix.default_database_type %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if file_type in ("btree", "cdb", "dbm", "hash", "sdbm") %}
|
{%- if file_type in ("btree", "cdb", "dbm", "hash", "sdbm") %}
|
||||||
{%- set need_newaliases = True %}
|
{%- set need_newaliases = True %}
|
||||||
|
Loading…
Reference in New Issue
Block a user