paulbsd-salt/states/postfix/config.sls

48 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-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-30 14:07:11 +02:00
{%- if postfix.db == 'pgsql' %}
postfix-pgsql-dir:
file.directory:
- name: {{ postfix.base_dir }}/pgsql
- user: root
- group: root
2020-07-19 14:45:46 +02:00
{%- for key, value in postfix.config.pgsql.files.items() %}
2020-07-19 14:18:16 +02:00
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
2020-07-19 14:45:46 +02:00
- source: salt://postfix/templates/pgsql.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:
2020-07-19 14:45:46 +02:00
config: {{ postfix.config.pgsql.config }}
query: {{ value.query }}
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 %}
2020-07-30 14:07:11 +02:00
{%- endif %}