Skip to content

Commit f6a7bbb

Browse files
committed
Install qcluster. Switch to redis.
1 parent 9f6f5d0 commit f6a7bbb

File tree

7 files changed

+48
-8
lines changed

7 files changed

+48
-8
lines changed

defaults/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,12 @@ mailman3_distribute_maps_virtualenv_dir: "{{ mailman3_core_var_dir }}/distribute
358358
# Base set of Python packages
359359
__mailman3_pip_packages:
360360
# - django-allauth==0.54.0
361+
- django-mailman3==1.3.13
361362
- importlib-resources==5.13.0
362363
- mailman
363364
- mailman-web==0.0.9
364-
- HyperKitty==1.3.9
365-
- django-allauth==0.61.1
365+
- HyperKitty==1.3.10
366+
- django-allauth==0.63.3
366367
- mailman-hyperkitty # ??
367368
- elasticsearch==7.17.9
368369
- environs
@@ -390,8 +391,9 @@ __mailman3_system_dependency_packages:
390391
- python3
391392
- python3-venv
392393
- python3-setuptools
393-
- memcached
394-
- libmemcached-tools
394+
# - memcached
395+
# - libmemcached-tools
396+
- redis
395397
redhat-7:
396398
- rh-python38 # requires EL7+ and CentOS SCL
397399
redhat-8:

handlers/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
- mailman3_process_manager == "systemd"
3030
- ansible_virtualization_type != "docker"
3131

32+
- name: Restart qcluster service # noqa command-instead-of-module
33+
ansible.builtin.command: systemctl try-reload-or-restart qcluster.service
34+
changed_when: false
35+
when:
36+
- mailman3_process_manager == "systemd"
37+
- ansible_virtualization_type != "docker"
38+
3239
- name: Restart nginx
3340
ansible.builtin.service:
3441
name: nginx

tasks/django.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
user: "{{ __mailman3_web_user_name }}"
110110
minute: "{{ item.minute | default(omit) }}"
111111
special_time: "{{ item.special_time | default(omit) }}"
112-
job: "MAILMAN_WEB_CONFIG={{ mailman3_django_project_dir }}/settings.py {{ mailman3_install_dir }}/bin/mailman-web runjobs {{ item.name | default(item.special_time) }}"
112+
job: "MAILMAN_WEB_CONFIG={{ mailman3_django_project_dir }}/settings.py {{ mailman3_install_dir }}/bin/mailman-web runjobs {{ item.name | default(item.special_time) }} > {{ item.name | default(item.special_time) }}.txt 2>&1"
113113
loop:
114114
- special_time: hourly
115115
- special_time: daily

tasks/install_pip.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
dest: "{{ mailman3_core_service_name }}.service"
9090
- src: mailman3-web.service
9191
dest: "{{ mailman3_web_service_name }}{{ '@' if mailman3_domains is defined else '' }}.service"
92+
- src: qcluster.service
93+
dest: qcluster.service
9294
loop_control:
9395
label: "{{ item.dest }}"
9496
when: mailman3_process_manager == 'systemd'
@@ -97,6 +99,7 @@
9799
# TODO: split tasks to only restart the affected service
98100
- Restart mailman3-core service
99101
- Restart mailman3-web service
102+
- Restart qcluster service
100103

101104
- name: Install systemd socket unit file
102105
ansible.builtin.template:

tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,10 @@
6767
state: started
6868
loop: "{{ mailman3_domains | default(['']) }}"
6969
when: mailman3_process_manager != "supervisor"
70+
71+
- name: Ensure qcluster is enabled and running
72+
ansible.builtin.service:
73+
name: qcluster
74+
enabled: true
75+
state: started
76+
when: mailman3_process_manager != "supervisor"

templates/qcluster.service.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=HyperKitty async tasks runner
3+
After=network.target remote-fs.target
4+
ConditionPathExists={{ mailman3_django_project_dir }}/settings.py
5+
6+
[Service]
7+
Environment="MAILMAN_WEB_CONFIG={{ mailman3_django_project_dir }}/settings.py"
8+
ExecStart={{ mailman3_install_dir }}/bin/mailman-web qcluster
9+
User={{ __mailman3_web_user_name }}
10+
Group={{ __mailman3_web_group_name }}
11+
Restart=always
12+
13+
[Install]
14+
WantedBy=multi-user.target

templates/settings.py.j2

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ DATABASES = {
2626
}
2727
}
2828

29+
# CACHES = {
30+
# 'default': {
31+
# "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
32+
# 'LOCATION': '127.0.0.1:11211',
33+
# }
34+
# }
35+
2936
CACHES = {
30-
'default': {
31-
'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
32-
'LOCATION': '127.0.0.1:11211',
37+
"default": {
38+
"BACKEND": "django.core.cache.backends.redis.RedisCache",
39+
"LOCATION": "redis://127.0.0.1:6379",
3340
}
3441
}
3542

0 commit comments

Comments
 (0)