Files
ansible-playbooks/roles/mail_server/tasks/main.yml
T

59 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
- name: 1. Установка почтового стека
apt:
name:
- postfix
- postfix-ldap
- dovecot-imapd
- dovecot-lmtpd
- dovecot-ldap
- opendkim
- opendkim-tools
- postfix-policyd-spf-python
- libsasl2-modules-ldap
state: present
update_cache: yes
- name: 1.1 Установка Rspamd и Redis
apt:
name:
- rspamd
- redis-server # Redis нужен Rspamd для кеширования и обучения
state: present
- name: 1.2 Обеспечение работы Redis
service:
name: redis-server
state: started
enabled: yes
- name: 2. Настройка прав на /var/mail (для ZFS датасета)
# Так как контейнер unprivileged (idmap), владелец на хосте должен быть 1000000 + 8 (mail)
delegate_to: localhost
file:
path: /pool/bit-mail-data
owner: 1000008
group: 1000008
mode: '0775'
state: directory
- name: 3. Конфигурация Postfix (main.cf)
template:
src: postfix_main.cf.j2
dest: /etc/postfix/main.cf
notify: restart_postfix
- name: 4. Настройка OpenDKIM
template:
src: opendkim.conf.j2
dest: /etc/opendkim.conf
notify: restart_opendkim
- name: 5. Настройка Dovecot для работы с LDAP
template:
src: dovecot-ldap.conf.ext.j2
dest: /etc/dovecot/dovecot-ldap.conf.ext
notify: restart_dovecot