summaryrefslogtreecommitdiffstats
path: root/roles/lists/tasks/sympa.yml
blob: 402518f2c1a04cbdae4e0881257b64bc3a509aaf (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
- apt: pkg={{ item }} install_recommends=no
  with_items:
    - mysql-server
    - sympa

- name: Make the 'sympa' MySQL user use auth_socket
  mysql_user: name=sympa password= auth_plugin=auth_socket
              state=present

# XXX We want to change the retun-path for sendpasswd notices from
# 'sympa-request@$robot' to 'noreply@fripost.org'.
#   * /usr/lib/cgi-bin/sympa/wwsympa.fcgi
#       do_requestpasswd, do_subrequest: add $param->{'return_path'}='noreply@fripost.org';
#   * List::send_global_file
#       $data->{'return_path'} //= &Conf::get_robot_conf($robot, 'request');
- name: Configure Sympa
  copy: src=etc/sympa/{{ item }}
        dest=/etc/sympa/{{ item }}
        owner=root group=sympa
        mode=0644
  with_items:
    - sympa.conf
    - wwsympa.conf
    - topics.conf
  register: r1
  notify:
    - Restart Sympa

- name: Create Virtual hosts for Sympa (1)
  file: path=/etc/sympa/{{ item }}
        state=directory
        owner=root group=root
        mode=0755
  with_items:
    - lists.fripost.org
  register: r2
  notify:
    - Restart Sympa

- name: Create Virtual hosts for Sympa (2)
  file: path=/var/lib/sympa/list_data/{{ item }}
        state=directory
        owner=sympa group=sympa
        mode=0770
  with_items:
    - lists.fripost.org
  register: r3
  notify:
    - Restart Sympa

- name: Install robot.conf
  template: src=etc/sympa/robot.conf.j2
            dest=/etc/sympa/{{ item }}/robot.conf
            owner=root group=root
            mode=0644
  with_items:
    - lists.fripost.org
  register: r4
  notify:
    - Restart Sympa

# sympa uses to syslog, there is no need to reload or restart it when
# rotating logs
- name: Don't restart sympa on logrotate
  lineinfile: "dest=/etc/logrotate.d/sympa state=absent
               regexp='\\bsympa reload\\b'"
  tags:
    - logrotate

- name: Start Sympa
  service: name=sympa state=started
  when: not (r1.changed or r2.changed or r3.changed or r4.changed)

- meta: flush_handlers

- name: Copy wwsympa.{service,socket}
  copy: src=lib/systemd/system/{{ item }}
        dest=/lib/systemd/system/{{ item }}
        owner=root group=root
        mode=0644
  notify:
    - systemctl daemon-reload
    - Restart wwsympa
  with_items:
    - wwsympa.service
    - wwsympa.socket

- meta: flush_handlers

- name: Enable WWSympa
  service: name=wwsympa enabled=yes

- name: Start WWSympa
  service: name=wwsympa state=started