paulbsd-salt/states/postfix/init.sls

73 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "postfix/map.jinja" import postfix with context %}
postfix-pkg:
pkg.latest:
- name: postfix
postfix-pgsql-dir:
file.directory:
- name: {{ postfix.base_dir }}/pgsql
- user: root
- group: root
postfix-main-cf:
file.managed:
- name: {{ postfix.base_dir }}/main.cf
- source: salt://postfix/main.cf.j2
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
postfix-master-cf:
file.managed:
- name: {{ postfix.base_dir }}/master.cf
- source: salt://postfix/master.cf.j2
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
postfix-transport-maps:
file.managed:
- name: {{ postfix.base_dir }}/transport
- source: salt://postfix/transport.j2
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
- cmd: postfix-transport
postfix-sender-access-maps:
file.managed:
- name: {{ postfix.base_dir }}/sender_access
- source: salt://postfix/sender_access.j2
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
- cmd: postfix-sender-access
postfix-transport:
cmd.run:
- name: postmap transport
- cwd: {{ postfix.base_dir }}
postfix-sender-access:
cmd.run:
- name: postmap sender_access
- cwd: {{ postfix.base_dir }}
postfix-service:
service.running:
- name: postfix
- enable: True
- reload: True