infra/playbooks/roles/mail/tasks/main.yml

57 lines
1.3 KiB
YAML

---
- name: Ensure mail docker/compose exist
ansible.builtin.file:
path: /etc/docker/compose/mail
state: directory
owner: root
group: root
mode: 0700
- name: Ensure mail config volume exist
file:
path: /etc/docker/compose/mail/docker-data/dms/config
state: directory
owner: root
group: root
mode: 0700
- name: Ensure mail entries volume exist with correct permission
file:
path: /etc/docker/compose/mail/docker-data/dms/mail-data/
state: directory
owner: root
group: root
mode: 0777
recurse: true
- name: Ensure dovecot ldap config exist
ansible.builtin.template:
src: user-patches.sh.j2
dest: /etc/docker/compose/mail/docker-data/dms/config/user-patches.sh
owner: root
group: root
mode: 0755
- name: Ensure config user overrides config exist
ansible.builtin.template:
src: dovecot-ldap.conf.j2
dest: /etc/docker/compose/mail/docker-data/dms/config/dovecot-ldap.conf
owner: root
group: root
mode: 0700
- name: Build mail docker-compose.yml.j2
ansible.builtin.template:
src: docker-compose.yml.j2
dest: /etc/docker/compose/mail/docker-compose.yml
owner: root
group: root
mode: 0700
- name: Daemon-reload and enable mail
ansible.builtin.systemd_service:
state: restarted
enabled: true
name: docker-compose@mail