clean up some old task
[ansible.git] / roles / email / tasks / mailman.yml
1 - name: install mailman
2   apt: name=mailman state=latest
3 - name: configure mailman
4   template:
5     dest: /etc/mailman/mm_cfg.py
6     src: templates/mm_cfg.py
7   notify: mailman
8 - name: install mailman-check cronjob
9   copy:
10     dest: /etc/cron.daily/mailman-check
11     src: files/mailman-check
12     mode: u=rwx,g=rx,o=rx
13 # the CAPTCHA patch (and some template modifications)
14 - name: check if the files are already patched
15   shell: 'fgrep MAILMAN_CAPTCHA_PATCHED Cgi/listinfo.py && fgrep MAILMAN_CAPTCHA_PATCHED Cgi/subscribe.py'
16   args:
17     chdir: /usr/lib/mailman/Mailman
18   changed_when: False
19   failed_when: mailman_patched.rc == 2
20   register: mailman_patched
21 - name: check if all the files have the right checksums to be patched
22   shell: 'echo "{{item}}" | sha256sum -c'
23   loop:
24     - "621368ef38d991be46e4537b1d5444276579cd60cc721a749d500dd0b98efe27  /usr/lib/mailman/Mailman/Cgi/listinfo.py"
25     - "c6e46afe1c016d6853c8397916a6f6fd88c6cea71ae890ef3680617f1f8f7c9a  /usr/lib/mailman/Mailman/Cgi/subscribe.py"
26   changed_when: False
27   when: mailman_patched.rc != 0
28 - name: install patched python files
29   copy:
30     dest: /usr/lib/mailman/Mailman/{{item}}
31     src: files/mailman-patched/{{item}}
32   loop:
33   - Cgi/listinfo.py
34   - Cgi/subscribe.py
35   - Captcha.py
36   when: mailman_patched.rc != 0
37 - name: install patched templates
38   copy:
39     dest: /etc/mailman/{{item}}
40     src: files/mailman-patched/{{item}}
41   loop:
42   - de/listinfo.html
43   - de/subscribeack.txt
44   - en/listinfo.html
45   - en/subscribeack.txt