paulbsd-salt/states/postfix/config.sls

46 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-07-19 14:13:51 +02:00
---
{%- from "postfix/map.jinja" import postfix with context %}
postfix-pgsql-dir:
file.directory:
- name: {{ postfix.base_dir }}/pgsql
- user: root
- group: root
postfix-main-cf:
file.managed:
2020-07-19 14:32:59 +02:00
- name: {{ postfix.base_dir }}/main.cf
2020-07-19 14:13:51 +02:00
- source: salt://postfix/templates/main.cf.j2
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
2020-07-19 14:18:16 +02:00
postfix-master-cf:
2020-07-19 14:13:51 +02:00
file.managed:
2020-07-19 14:18:16 +02:00
- name: {{ postfix.base_dir }}/master.cf
- source: salt://postfix/templates/master.cf.j2
2020-07-19 14:13:51 +02:00
- user: root
- group: root
- mode: 644
- template: jinja
- watch_in:
- service: postfix-service
2020-07-19 14:18:16 +02:00
{%- for key, value in postfix.config.pgsql.items() %}
postfix-pgsql-{{ key }}:
2020-07-19 14:13:51 +02:00
file.managed:
2020-07-19 14:18:16 +02:00
- name: {{ postfix.base_dir }}/pgsql/{{ key }}.cf
- source: salt://postfix/templates/plain.cf.j2
2020-07-19 14:13:51 +02:00
- user: root
- group: root
- mode: 644
- template: jinja
2020-07-19 14:32:59 +02:00
- context:
value: |
{{ value|indent(8) }}
2020-07-19 14:13:51 +02:00
- watch_in:
2020-07-19 14:18:16 +02:00
- service: postfix-service
2020-07-19 14:32:59 +02:00
{% endfor %}