diff --git a/roles/mailman/tasks/main.yml b/roles/mailman/tasks/main.yml index 532277e284..3a36a0e52e 100644 --- a/roles/mailman/tasks/main.yml +++ b/roles/mailman/tasks/main.yml @@ -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') diff --git a/roles/mailman/templates/webui-warm-up-cache.service.j2 b/roles/mailman/templates/webui-warm-up-cache.service.j2 new file mode 100644 index 0000000000..8c251a4129 --- /dev/null +++ b/roles/mailman/templates/webui-warm-up-cache.service.j2 @@ -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