aboutsummaryrefslogtreecommitdiff
path: root/roles/dovecot/tasks/main.yml
blob: ce5eb2ccd08cc224e2f7ab84e0c1ae42c76f9535 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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