This repository has been archived on 2020-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-dovecot/tasks/main.yml

51 lines
1.3 KiB
YAML

- name: Copy configuration files
loop:
- 'dovecot.conf'
template:
src: '{{ item }}.j2'
dest: '/etc/dovecot/{{ item }}'
follow: yes
tags:
- dovecot
- config
notify: Run service actions
- name: Copy sieve filters
loop:
- 'default.sieve'
template:
src: '{{ item }}.j2'
dest: '/var/lib/dovecot/sieve/{{ item }}'
follow: yes
tags:
- dovecot
- config
- sieve
notify: Run service actions
- name: Change ownership of dovecot dir
command:
argv: ["chown", "-R", "vmail:vmail", "/var/lib/dovecot"]
warn: false
tags:
- dovecot
- file
- name: Compile sieve scripts
command:
argv: ["sievec", "/var/lib/dovecot/sieve/default.sieve"]
tags:
- dovecot
- sieve
- name: Set up PAM authentication
loop:
- { name: 'dovecot', control: required, type: auth, module_path: 'pam_unix.so', module_args: '' }
- { name: 'dovecot', control: required, type: account, module_path: 'pam_unix.so', module_args: '' }
pamd:
name: '{{ item.name }}'
control: '{{ item.control }}'
type: '{{ item.type }}'
module_path: '{{ item.module_path }}'
module_arguments: '{{ item.module_args }}'
tags:
- dovecot
- pam
notify: Run service actions