Template paths and groups to make them work on FreeBSD, too.

This commit is contained in:
Florian Ermisch 2017-08-24 13:02:46 +02:00 committed by Wurzel Kollektiv
parent af5e9f8862
commit 099d84ab73
3 changed files with 20 additions and 19 deletions

View File

@ -1,19 +1,20 @@
{% from "postfix/map.jinja" import postfix with context %}
include:
- postfix
/etc/postfix:
{{ postfix.config_path }}:
file.directory:
- user: root
- group: root
- group: {{ postfix.root_grp }}
- dir_mode: 755
- file_mode: 644
- makedirs: True
/etc/postfix/main.cf:
{{ postfix.config_path }}/main.cf:
file.managed:
- source: salt://postfix/files/main.cf
- user: root
- group: root
- group: {{ postfix.root_grp }}
- mode: 644
- require:
- pkg: postfix
@ -22,7 +23,7 @@ include:
- template: jinja
{% if 'vmail' in pillar.get('postfix', '') %}
/etc/postfix/virtual_alias_maps.cf:
{{ postfix.config_path }}/virtual_alias_maps.cf:
file.managed:
- source: salt://postfix/files/virtual_alias_maps.cf
- user: root
@ -34,7 +35,7 @@ include:
- service: postfix
- template: jinja
/etc/postfix/virtual_mailbox_domains.cf:
{{ postfix.config_path }}/virtual_mailbox_domains.cf:
file.managed:
- source: salt://postfix/files/virtual_mailbox_domains.cf
- user: root
@ -46,7 +47,7 @@ include:
- service: postfix
- template: jinja
/etc/postfix/virtual_mailbox_maps.cf:
{{ postfix.config_path }}/virtual_mailbox_maps.cf:
file.managed:
- source: salt://postfix/files/virtual_mailbox_maps.cf
- user: root
@ -60,11 +61,11 @@ include:
{% endif %}
{% if salt['pillar.get']('postfix:manage_master_config', True) %}
/etc/postfix/master.cf:
{{ postfix.config_path }}/master.cf:
file.managed:
- source: salt://postfix/files/master.cf
- user: root
- group: root
- group: {{ postfix.root_grp }}
- mode: 644
- require:
- pkg: postfix
@ -74,11 +75,11 @@ include:
{% endif %}
{% if 'transport' in pillar.get('postfix', '') %}
/etc/postfix/transport:
{{ postfix.config_path }}/transport:
file.managed:
- source: salt://postfix/files/transport
- user: root
- group: root
- group: {{ postfix.root_grp }}
- mode: 644
- require:
- pkg: postfix
@ -88,10 +89,10 @@ include:
run-postmap:
cmd.wait:
- name: /usr/sbin/postmap /etc/postfix/transport
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ postfix.config_path }}/transport
- cwd: /
- watch:
- file: /etc/postfix/transport
- file: {{ postfix.config_path }}/transport
{% endif %}
{%- for domain in salt['pillar.get']('postfix:certificates', {}).keys() %}
@ -99,7 +100,7 @@ run-postmap:
postfix_{{ domain }}_ssl_certificate:
file.managed:
- name: /etc/postfix/ssl/{{ domain }}.crt
- name: {{ postfix.config_path }}/ssl/{{ domain }}.crt
- makedirs: True
- contents_pillar: postfix:certificates:{{ domain }}:public_cert
- watch_in:
@ -107,7 +108,7 @@ postfix_{{ domain }}_ssl_certificate:
postfix_{{ domain }}_ssl_key:
file.managed:
- name: /etc/postfix/ssl/{{ domain }}.key
- name: {{ postfix.config_path }}/ssl/{{ domain }}.key
- mode: 600
- makedirs: True
- contents_pillar: postfix:certificates:{{ domain }}:private_key

View File

@ -133,5 +133,5 @@ scache unix - - n - 1 scache
# ${nexthop} ${user}
{% if salt['pillar.get']('postfix:policyd-spf:enabled', False) %}
policy-spf unix - n n - - spawn
user=nobody argv=/usr/bin/policyd-spf
user=nobody argv={{ xbin_prefix }}/bin/policyd-spf
{%- endif %}

View File

@ -33,7 +33,7 @@ postfix_alias_database:
- name: {{ file_path }}
- source: salt://postfix/aliases
- user: root
- group: root
- group: {{ postfix.root_grp }}
- mode: 644
- template: jinja
- require:
@ -77,7 +77,7 @@ postfix_{{ mapping }}:
- name: {{ file_path }}
- source: salt://postfix/files/mapping.j2
- user: root
- group: root
- group: {{ postfix.root_grp }}
{%- if mapping.endswith('_sasl_password_maps') %}
- mode: 600
{%- else %}
@ -90,7 +90,7 @@ postfix_{{ mapping }}:
- pkg: postfix
{%- if need_postmap %}
cmd.wait:
- name: /usr/sbin/postmap {{ file_path }}
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ file_path }}
- cwd: /
- watch:
- file: {{ file_path }}