From 724d877995dfcc10c462a18dcb4ea6c8b60c2d03 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 2 Jul 2023 19:04:30 -0400 Subject: initial commit --- roles/dovecot/tasks/main.yml | 67 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 roles/dovecot/tasks/main.yml (limited to 'roles/dovecot/tasks') diff --git a/roles/dovecot/tasks/main.yml b/roles/dovecot/tasks/main.yml new file mode 100644 index 0000000..ce5eb2c --- /dev/null +++ b/roles/dovecot/tasks/main.yml @@ -0,0 +1,67 @@ +- name: install packages + package: + name: + - dovecot-imapd + - dovecot-sieve + state: latest + +- name: deploy dovecot.conf + copy: + src: dovecot.conf + dest: /etc/dovecot/dovecot.conf + owner: root + group: root + mode: '0644' + +- name: deploy dovecot configuration files + copy: + src: "{{ item }}" + dest: /etc/dovecot/conf.d/ + owner: root + group: root + mode: '0644' + with_fileglob: "files/conf.d/*" + +- name: deploy dovecot tls configuration file + template: + src: templates/10-ssl.conf.j2 + dest: /etc/dovecot/conf.d/10-ssl.conf + owner: root + group: root + mode: '0644' + +- name: create sieve dir + file: + path: /var/lib/dovecot/sieve + state: directory + +- name: deploy default sieve script + copy: + src: default.sieve + dest: /var/lib/dovecot/sieve/default.sieve + owner: root + group: root + mode: '0644' + +- name: compile default sieve script + command: + cmd: sievec /var/lib/dovecot/sieve/default.sieve + +- name: deploy dovecot PAM configuration + copy: + src: dovecot_pam + dest: /etc/pam.d/dovecot + owner: root + group: root + mode: '0644' + +- name: enable dovecot + systemd: + enabled: yes + masked: no + name: dovecot + +- name: restart dovecot + service: + name: dovecot + state: restarted -- cgit v1.2.3