From 4a4af42f191fcc56107b23141c498589759e4c6f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 26 Nov 2018 17:42:28 +0100 Subject: [PATCH] CKAN: reload the service immediately after the switch to memcache backed sessions. --- ckan/ckan/tasks/ckan-memcache.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ckan/ckan/tasks/ckan-memcache.yml b/ckan/ckan/tasks/ckan-memcache.yml index 95dfe3d6..44f467c5 100644 --- a/ckan/ckan/tasks/ckan-memcache.yml +++ b/ckan/ckan/tasks/ckan-memcache.yml @@ -15,13 +15,17 @@ - name: Configure CKAN so that it uses memcache for its sessions ini_file: dest={{ ckan_config_file }} section={{ item.section }} option={{ item.option }} value={{ item.value }} state={{ item.state }} with_items: '{{ ckan_memcache_ini_opts }}' - notify: - - Restart CKAN - - Restart fetch and gather consumers + notify: Restart fetch and gather consumers + register: ckan_use_memcache tags: [ 'ckan', 'ckan_ini', 'ckan_plugins', 'ckan_sessions', 'ckan_memcache' ] + - name: Restart CKAN after enabling the memcache sessions configuration + service: name=apache2 state=reloaded + when: ckan_use_memcache is changed + - name: Remove the CKAN session files file: dest=/tmp/{{ ckan_site_id }}/sessions state=absent + ignore_errors: True become: False when: ckan_memcache_sessions is defined and ckan_memcache_sessions