Skip to content

Commit 48a156a

Browse files
committed
mailinglist-server: add new role for mailman3
Add a new role to install mailman3, initially used on server kazama and includes the apache2-server role update to include a lists webserver config.
1 parent 01fff88 commit 48a156a

File tree

11 files changed

+154
-0
lines changed

11 files changed

+154
-0
lines changed

host_vars/kazama.on

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,15 @@ olsr_hna_announcements_ipv4:
1313
# Erreichbarkeit der oeffentlichen IP im olsr-Mesh
1414
- 46.4.100.213
1515

16+
letsencrypt_certificates:
17+
- { on_tld_base: lists }
18+
19+
apache2_sites:
20+
- { name: lists }
21+
apache2_mods:
22+
- { name: proxy }
23+
- { name: proxy_http }
24+
- { name: proxy_http2 }
25+
- { name: proxy_uwsgi }
26+
1627
debian_release: bookworm

playbook-servers.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
- hosts: kazama.on
7373
roles:
7474
- wireguard-server
75+
- mailinglist-server
7576

7677
# mediawiki in development
7778
- hosts: hikaru.on
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# {{ ansible_managed }}
2+
3+
Alias /mailman3/favicon.ico /var/lib/mailman3/web/static/postorius/img/favicon.ico
4+
Alias /mailman3/static /var/lib/mailman3/web/static
5+
6+
<Directory "/var/lib/mailman3/web/static">
7+
Require all granted
8+
</Directory>
9+
10+
<IfModule mod_proxy_uwsgi.c>
11+
ProxyPass /mailman3/favicon.ico !
12+
ProxyPass /mailman3/static !
13+
ProxyPass / unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
14+
</IfModule>

roles/mailinglist-server/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
= Überblick =
2+
Diese Rolle installiert die Opennet Mailinglisten Rolle.
3+
4+
Enthalten sind:
5+
* Paketinstallation
6+
* Grundkonfiguration
7+
8+
Voraussetzungen:
9+
* Hostname od. Sub-Domain für Mailinglisten-Betrieb im DNS pflegen
10+
* bei Sub-Domain entsprechende MX Records setzen
11+
* Apache2 mit Modulen proxy / proxy_uwsgi
12+
13+
= Konfiguration =
14+
15+
Typische Ansible Host-Konfiguration:
16+
17+
```
18+
letsencrypt_certificates:
19+
- { on_tld_base: lists }
20+
apache2_sites:
21+
- { name: lists }
22+
apache2_mods:
23+
- { name: proxy }
24+
- { name: proxy_http }
25+
- { name: proxy_http2 }
26+
- { name: proxy_uwsgi }
27+
```
28+
29+
Benötigte Apache Site Konfiguration:
30+
(Vorlage in /etc/mailman3/apache.conf)
31+
32+
```
33+
Alias /mailman3/favicon.ico /var/lib/mailman3/web/static/postorius/img/favicon.ico
34+
Alias /mailman3/static /var/lib/mailman3/web/static
35+
<Directory "/var/lib/mailman3/web/static">
36+
Require all granted
37+
</Directory>
38+
<IfModule mod_proxy_uwsgi.c>
39+
ProxyPass /mailman3/favicon.ico !
40+
ProxyPass /mailman3/static !
41+
ProxyPass / unix:/run/mailman3-web/uwsgi.sock|uwsgi://localhost/
42+
</IfModule>
43+
```
44+
45+
Manuelle Konfigurationsschritte:
46+
* initialen Benutzer (admin) + erreichbare E-Mail-Adresse anlegen via
47+
```
48+
dpkg-reconfigure mailman3-web
49+
```
50+
* Domain-Namen via Django-Webinterface setzen: https://<hostname>/admin/sites/site/
51+
```
52+
opennet-initiative.de, Opennet Initiative
53+
```
54+
55+
= TODO =
56+
57+
58+
* Favicon auf Opennet Logo anpassen
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
mailinglist_config_path: "/etc/mailman3"
2+
mailinglist_config: "{{ mailinglist_config_path }}/mailman.cfg"
3+
mailinglist_config_web: "{{ mailinglist_config_path }}/mailman-web.py"
4+
mailinglist_domain: "lists.opennet-initiative.de"
5+
mailinglist_owner: "admin@{{ mailinglist_domain }}"
6+
mailinglist_lang: "de"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- name: restart mailman3
2+
service: name=mailman3 state=restarted
3+
4+
- name: restart mailman3-web
5+
service: name=mailman3-web state=restarted
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: config-archive - Base URL setzen
2+
lineinfile:
3+
path: "{{ mailinglist_config_web }}"
4+
regexp: '^base_url:'
5+
line: "base_url: https://{{ mailinglist_domain }}/hyperkitty'"
6+
notify:
7+
- restart mailman3
8+
- restart mailman3-web
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: config-web - Default Domain setzen
2+
lineinfile:
3+
path: "{{ mailinglist_config_web }}"
4+
regexp: '^EMAILNAME ='
5+
line: "EMAILNAME = '{{ mailinglist_domain }}'"
6+
notify: restart mailman3-web
7+
8+
- name: config-web - Base URL setzen
9+
lineinfile:
10+
path: "{{ mailinglist_config_web }}"
11+
regexp: '^POSTORIUS_TEMPLATE_BASE_URL ='
12+
line: "POSTORIUS_TEMPLATE_BASE_URL = 'https://{{ mailinglist_domain }}/'"
13+
notify: restart mailman3-web
14+
15+
- name: config-web - Socialaccount Fedora App deaktivieren
16+
lineinfile:
17+
path: "{{ mailinglist_config_web }}"
18+
regexp: "^ 'django_mailman3.lib.auth.fedora'"
19+
line: " #'django_mailman3.lib.auth.fedora'"
20+
notify: restart mailman3-web
21+
22+
- name: config-web - Sprache setzen
23+
lineinfile:
24+
path: "{{ mailinglist_config_web }}"
25+
regexp: '^LANGUAGE_CODE ='
26+
line: "LANGUAGE_CODE = '{{ mailinglist_lang }}-{{ mailinglist_lang }}'"
27+
notify: restart mailman3-web
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- name: config - Site Owner setzen
2+
lineinfile:
3+
path: "{{ mailinglist_config }}"
4+
regexp: '^site_owner:'
5+
line: "site_owner: {{ mailinglist_owner }}"
6+
notify:
7+
- restart mailman3
8+
- restart mailman3-web
9+
10+
- name: config - Standard-Sprache setzen
11+
lineinfile:
12+
path: "{{ mailinglist_config }}"
13+
regexp: '^default_language:'
14+
line: "default_language: {{ mailinglist_lang }}"
15+
notify:
16+
- restart mailman3
17+
- restart mailman3-web
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: install - Mailman installieren
2+
apt:
3+
name: mailman3-full
4+
install_recommends: no

0 commit comments

Comments
 (0)