main.yml 1.32 KB
Newer Older
1
- name: Install Mailman 2 with Apache, Exim and nmzproc
2
3
4
5
6
  become: yes
  apt:
    name:
    - mailman
    - apache2
Wágner Ferenc's avatar
Wágner Ferenc committed
7
    - exim4-daemon-heavy # for the content scanning extension
8
    - nmzproc
9
10
11
  register: install_mailman
# mailman.service fails and tries to restart indefinitely (Site list is missing: mailman)

12
13
14
15
16
17
18
19
20
21
- name: Prepare update-exim4.conf.conf for the restricted_redirector router
  become: yes
  lineinfile:
    dest: /etc/exim4/update-exim4.conf.conf
    regexp: ^dc_{{ item.key }}=
    line: dc_{{ item.key }}='{{ item.value }}'
  with_dict:
   readhost: "{{ inventory_hostname }}"
   smarthost: redirector.niif.hu
   eximconfig_configtype: internet
22
   local_interfaces: ""
23
24
25
  when: not (ansible_check_mode and install_mailman is changed)
  notify: Reload Exim

26
27
- name: Integrate Mailman with Exim
  become: yes
28
  template:
29
30
31
32
33
34
    src: exim4.conf.template
    dest: /etc/exim4/exim4.conf.template
    owner: root
    group: root
    mode: 0644
  notify: Reload Exim
Wágner Ferenc's avatar
Wágner Ferenc committed
35

36
37
38
39
40
41
42
43
44
45
- name: Set up SMTP authentication database
  become: yes
  copy:
    src: exim_passwd
    dest: /etc/exim4/passwd
    owner: root
    group: Debian-exim
    mode: 0640
  when: vault_open is defined

Wágner Ferenc's avatar
Wágner Ferenc committed
46
47
48
49
50
51
52
53
54
- name: Configure Mailman
  become: yes
  template:
    src: mm_cfg.py
    dest: /etc/mailman/mm_cfg.py
    owner: root
    group: root
    mode: 0644
  notify: Restart Mailman