paulbsd-salt/states/dovecot/config.sls

61 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "dovecot/map.jinja" import dovecot with context %}
dovecot-imap-user:
user.present:
- name: {{ dovecot.imap_user }}
- uid: {{ dovecot.imap_user_id }}
2024-08-04 21:32:04 +02:00
dovecot-log-dir:
file.directory:
- name: /var/log/dovecot
- user: dovecot
- group: dovecot
2020-07-10 00:58:55 +02:00
{%- for name, config in dovecot.config.main.items() %}
dovecot-config-main-{{ name }}:
file.managed:
- name: {{ dovecot.config_dir }}/{{ name }}
2023-07-13 19:47:03 +02:00
- source: salt://dovecot/templates/config.j2
2020-07-10 00:58:55 +02:00
- template: jinja
- user: root
- group: root
- watch_in:
- service: dovecot-service
- context:
2023-01-20 13:23:56 +01:00
config: {{ config }}
2020-07-10 00:58:55 +02:00
{%- endfor %}
{%- for name, config in dovecot.config.confd.items() %}
dovecot-config-conf.d-{{ name }}:
file.managed:
- name: {{ dovecot.config_dir }}/conf.d/{{ name }}
2023-07-13 19:47:03 +02:00
- source: salt://dovecot/templates/config.j2
2020-07-10 00:58:55 +02:00
- template: jinja
- user: root
- group: root
- watch_in:
- service: dovecot-service
- context:
2023-01-20 13:23:56 +01:00
config: {{ config }}
2020-07-10 00:58:55 +02:00
{%- endfor %}
2023-10-10 09:06:30 +02:00
dovecot-sieve-dir:
file.directory:
- name: {{ dovecot.sieve_dir }}
{%- if dovecot.sieve_configfiles %}
{%- for configfile in dovecot.sieve_configfiles %}
dovecot-sieve-configfile-{{ configfile }}:
file.managed:
- name: {{ dovecot.sieve_dir }}/{{ configfile }}
- mode: '0755'
- source: salt://dovecot/templates/{{ configfile }}.j2
- template: jinja
{%- endfor %}
{%- endif %}
dovecot-sieve-refresh:
cmd.run:
- name: "{{ dovecot.sieve_dir }}/update_sieve.sh"
- cwd: {{ dovecot.sieve_dir }}