Skip to content

Commit 4c20510

Browse files
committed
mailman3_core_public_rest_api variable, so core and hyperkitty work on internal addresses
1 parent 27e4fdf commit 4c20510

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ mailman3_core_api_hostname: localhost
122122
mailman3_core_api_port: 8001
123123
mailman3_core_api_admin_user: restadmin
124124
mailman3_core_api_admin_pass: restpass
125+
mailman3_core_public_rest_api: false
125126

126127
# Using the default archiver secret key is not secure, generate a random key!
127128
mailman3_archiver_key: SecretArchiverAPIKey

tasks/nginx.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@
2929
dest: /etc/nginx/sites-enabled/default
3030
state: absent
3131
notify: Restart nginx
32+
33+
- name: Install certbot
34+
community.general.snap:
35+
name: certbot
36+
classic: true

tasks/server.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,21 @@
55
changed_when: false
66

77
- name: Set line in /etc/hosts
8+
when: mailman3_core_public_rest_api
89
ansible.builtin.lineinfile:
910
path: /etc/hosts
1011
regexp: "{{ inventory_hostname }}"
1112
line: "{{ ansible_default_ipv4.address | default(ansible_all_ipv4_addresses[0]) }} {{ inventory_hostname }} {{ ansible_hostname }}"
1213
owner: root
1314
group: root
1415
mode: '0644'
16+
17+
- name: Set line in /etc/hosts 127.0.1.1
18+
when: not mailman3_core_public_rest_api
19+
ansible.builtin.lineinfile:
20+
path: /etc/hosts
21+
regexp: "{{ inventory_hostname }}"
22+
line: "127.0.1.1 {{ inventory_hostname }} {{ ansible_hostname }}"
23+
owner: root
24+
group: root
25+
mode: '0644'

templates/vhost.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ upstream myapp {
33
server unix:/run/mailman3-web.sock;
44
}
55

6-
# This localhost vhost was needed for a process, before. Was it imports?
7-
# Add a comment about the reasons.
6+
# Perhaps for elasticsearch?
7+
# Or for core to communicate to hyperkitty on localhost
88

99
server {
1010
listen 80;

0 commit comments

Comments
 (0)