You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+165-35
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,23 @@
1
1
Mailman 3 Ansible Role
2
2
======================
3
3
4
-
See [docs/README.md](docs/README.md) for the C++ specific admin info.
5
-
6
-
`galaxyproject.mailman3` is an Ansible role to install the [Mailman 3][mailman3] suite. This role installs all
7
-
components of the suite: Mailman 3 Core, and the Django-based web interfaces, Postorius and Hyperkitty.
4
+
`cppalliance.mailman3` is an Ansible role to install the [Mailman 3][mailman3] suite, based on [galaxyproject.mailman3](https://github.com/galaxyproject/ansible-mailman3).
5
+
While `galaxyproject.mailman3` installed all components of the suite: Mailman 3 Core, and the Django-based web interfaces, Postorius and Hyperkitty, this current role
6
+
also adds basic installations of PostgreSQL, Postfix, and Nginx. Those 3rd party components are required by mailman3. However the option remains to install and
7
+
manage those separately if you prefer.
8
8
9
9
Mailman 3 is a complicated service with many parts. It is a good idea to familiarize yourself with them before
10
10
proceeding. See the [architecture documentation][mailman3_arch] for details.
11
11
12
+
See [docs/mailman3-core.md](docs/mailman3-core.md) for a version of this role that only installs mailman3-core and _not_ the web component.
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
20
+
Test has mainly been done on Ubuntu 22.04. Pull requests are welcome to verify and re-enable other OS versions.
19
21
20
22
Role Variables
21
23
--------------
@@ -25,50 +27,177 @@ Variables are described in detail in [`defaults/main.yml`](defaults/main.yml).
25
27
Dependencies
26
28
------------
27
29
28
-
There are no strict depdendencies, but production Mailman 3 services typically need Postfix and PostgreSQL. You may find
29
-
the following roles useful:
30
+
A production Mailman 3 service typically needs Postfix, PostgreSQL, and Nginx. If you choose to install them separately, the following roles may be useful:
A default installation of this role `cppalliance.mailman3` will include those packages, as discussed below.
39
+
40
+
PostgreSQL
41
+
----------
42
+
43
+
The playbook `playbooks/mailman3-playbook.yml` includes a database-specific play and will call `postgres.yml` to install the database.
44
+
45
+
```
46
+
---
47
+
- hosts: mailman3-database
48
+
tasks:
49
+
- name: Install DB
50
+
ansible.builtin.include_role:
51
+
name: cppalliance.mailman3
52
+
tasks_from: database/main.yml
53
+
```
54
+
55
+
Decide which server will host the database. It might be the mailman instance or a backend DB server. Add that server to the inventory (the hosts file) in the `mailman3-database` group. Run the playbook.
56
+
57
+
Otherwise, to manage the DB externally, don't put any hosts to the `mailman3-database` group. Or modify the play. Follow your own method to install a database.
58
+
59
+
Postgres configuration variables (named mailman3_database_) can be found in `defaults/main.yml`.
60
+
61
+
Postfix
62
+
-------
63
+
64
+
The factor determining whether Postfix will be installed is the `mailman3_mta` variable in defaults/main.yml. If you choose to set the value of `mailman3_mta` to anything other than `postfix` it will avoid a Postfix installation.
65
+
66
+
Postfix related variables include `mailman3_relayhost` and `mailman3_sasl_passwd`. You _should_ configure those, but you may also choose to set each of those variables to an empty string `''` so they are not added in postfix/main.cf.
67
+
68
+
`postfix/main.cf` is a role template and may be customized or replaced.
69
+
70
+
Nginx
71
+
-----
72
+
73
+
The factor determining whether Nginx will be installed is the `mailman3_install_nginx` variable in defaults/main.yml. If you choose to set the value to `false` it will avoid an Nginx installation.
74
+
75
+
This role doesn't install SSL certificates, but you should likely add them. Review the `mailman3_nginx_ssl_certs` variable which starts out using self-signed certificates. After you have installed valid certificates set that variable to use another configuration.
76
+
37
77
Example Playbook
38
78
----------------
39
79
40
-
A relatively simple, single-site setup using PostgreSQL as the database backend:
80
+
A playbook has been included in playbooks/mailman3-playbook.yml:
81
+
82
+
```
83
+
---
84
+
- hosts: mailman3-database
85
+
become: true
86
+
remote_user: ubuntu
87
+
tasks:
88
+
- name: Install DB
89
+
ansible.builtin.include_role:
90
+
name: cppalliance.mailman3
91
+
tasks_from: database/main.yml
92
+
93
+
- hosts: mailman3
94
+
become: true
95
+
remote_user: ubuntu
96
+
roles:
97
+
- role: cppalliance.mailman3
98
+
99
+
```
100
+
101
+
In the inventory `hosts` file add servers to the `mailman3` and `mailman3-database` groups. Configure variables in a file such as host_vars/mailman.example.org/vars.
102
+
The following example uses a network connection to reach the database:
# With a unix socket the db username should match the linux username, which is often "mailman3-web".
191
+
username: mailman3-web
192
+
password: mypassword
193
+
subnet: "0.0.0.0/0"
194
+
- name: mailman3_core
195
+
username: mailman3_core
196
+
password: mypassword
197
+
subnet: "0.0.0.0/0"
69
198
```
70
199
71
-
A more complex setup with multiple list domains, Xapian haystack engine, distribution of Postfix lmtp maps to MX
200
+
The next example comes from the original galaxyproject role. A more complex setup with multiple list domains, Xapian haystack engine, distribution of Postfix lmtp maps to MX
72
201
servers, and DKIM:
73
202
74
203
```yaml
@@ -137,4 +266,5 @@ MIT
137
266
Author Information
138
267
------------------
139
268
269
+
The [CPPAlliance](https://cppalliance.org)
140
270
The [Galaxy Community](https://galaxyproject.org/) and [contributors](https://github.com/galaxyproject/ansible-mailman3/graphs/contributors)
0 commit comments