Mailman: add a boot-only service to warm up the cache

This commit is contained in:
Aurélien Bompard 2017-06-27 08:36:29 +00:00
parent bea63b4407
commit 364f0fd2fa
2 changed files with 24 additions and 2 deletions

View file

@ -439,8 +439,11 @@
tags: mailman
# Systemd
- name: install the systemd service file
template: src=webui-qcluster.service.j2 dest=/etc/systemd/system/webui-qcluster.service
- name: install the systemd service files
template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item }}.service
with_items:
- webui-qcluster
- webui-warm-up-cache
notify:
- systemctl daemon-reload
tags:
@ -488,3 +491,10 @@
- webui-qcluster
tags: mailman
when: inventory_hostname.startswith('mailman01.phx2') or inventory_hostname.startswith('lists-dev')
- name: enable one-shot services
service: enabled=yes name={{ item }}
with_items:
- webui-warm-up-cache
tags: mailman
when: inventory_hostname.startswith('mailman01.phx2') or inventory_hostname.startswith('lists-dev')

View file

@ -0,0 +1,12 @@
[Unit]
Description=Mailman web UI warm up cache
Requires=memcached.service
After=memcached.service
[Service]
Type=oneshot
ExecStart=/usr/bin/django-admin hyperkitty_warm_up_cache --pythonpath {{ mailman_webui_confdir }} --settings settings -v 2
User=apache
[Install]
WantedBy=multi-user.target