-
Kristian Klausen authored
We want to migrate to mailman3 as mailman2 is basically unmaintained and requires Python 2 which is EOL. Because the mailman and mailman3 packages conflict and we don't want to perform a big bang migration, mailman3 must be deployed on a separate server. mailman-web (mailman3's web interface) hasn't been packaged yet, so for now we are using my homebrewed PKGBUILD[1]. [1] https://gist.github.com/klausenbusk/5982063f95c503754a51ed2fefb8915e Ref #59
Kristian Klausen authoredWe want to migrate to mailman3 as mailman2 is basically unmaintained and requires Python 2 which is EOL. Because the mailman and mailman3 packages conflict and we don't want to perform a big bang migration, mailman3 must be deployed on a separate server. mailman-web (mailman3's web interface) hasn't been packaged yet, so for now we are using my homebrewed PKGBUILD[1]. [1] https://gist.github.com/klausenbusk/5982063f95c503754a51ed2fefb8915e Ref #59
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
main.yml 2.46 KiB
---
- name: create ssl cert
include_role:
name: certificate
vars:
domains: ["{{ lists_domain }}"]
- name: install mailman, uwsgi-plugin-cgi and postfx
pacman: name=mailman,uwsgi-plugin-cgi,postfix,postfix-pcre state=present
- name: install mailman configuration
template: src=mm_cfg.py.j2 dest=/etc/mailman/mm_cfg.py follow=yes owner=root group=root mode=0644
notify: reload mailman
- name: install postfix configuration
template: src=main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root mode=0644
notify: reload postfix
- name: install postfix maps
copy: src={{ item }} dest=/etc/postfix/ owner=root group=root mode=0644
loop:
- aliases
- milter_header_checks
notify: run postmap
- name: install postfix templated maps
template: src={{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root mode=0644
loop:
- transport
notify: run postmap
- name: open firewall holes for postfix
ansible.posix.firewalld: service=smtp zone={{ item }} permanent=true state=enabled immediate=yes
loop:
-
- wireguard
when: configure_firewall
tags:
- firewall
- name: create mailman list
command: /usr/lib/mailman/bin/newlist -a mailman root@{{ lists_domain }} meG0n5Wq6dEWCA6s
args:
creates: /var/lib/mailman/lists/mailman
- name: configure mailman uwsgi service
copy: src=mailman.ini dest=/etc/uwsgi/vassals/ owner=mailman group=http mode=0644
- name: make nginx log dir
file: path=/var/log/nginx/{{ lists_domain }} state=directory owner=root group=root mode=0755
- name: set up nginx
template: src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/mailman.conf" owner=root group=root mode=644
notify: reload nginx
tags: ['nginx']
- name: start and enable postfix
systemd: name=postfix.service enabled=yes daemon_reload=yes state=started
- name: create drop-in directory for mailman.service
file: path=/etc/systemd/system/mailman.service.d state=directory owner=root group=root mode=0755
- name: install drop-in for mailman.service
copy: src=override.conf dest=/etc/systemd/system/mailman.service.d/ owner=root group=root mode=0644
notify: restart mailman
- name: start and enable mailman{.service,-*.timer}
systemd: name={{ item }} enabled=yes daemon_reload=yes state=started
loop:
- mailman.service