From 6dd1e2629dcd5f052076c826505ba1b072c399e7 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 13 Mar 2019 13:27:37 +0100 Subject: [PATCH] Tasks and defaults to install the ckanext-datesearch plugin. --- ckan/ckan/defaults/main.yml | 5 +++++ ckan/ckan/tasks/ckan-plugins.yml | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ckan/ckan/defaults/main.yml b/ckan/ckan/defaults/main.yml index 668812a5..db28e243 100644 --- a/ckan/ckan/defaults/main.yml +++ b/ckan/ckan/defaults/main.yml @@ -97,6 +97,11 @@ ckan_ga_reports_name: ga-report ckan_ga_reports_url: 'git+https://github.com/datagovuk/ckanext-ga-report.git#egg=ckanext-ga-report' ckan_profiler: False ckan_profiler_url: 'git+https://github.com/morty/ckanext-profile.git#egg=ckanext-profile' +# CKAN-DATESEARCH +ckan_datesearch: False +ckan_datesearch_name: datesearch +ckan_datesearch_state: present +ckan_datesearch_url: 'https://github.com/EUDAT-B2FIND/ckanext-datesearch' # Needed to install some CKAN plugins diff --git a/ckan/ckan/tasks/ckan-plugins.yml b/ckan/ckan/tasks/ckan-plugins.yml index 001c6a2a..80aaa695 100644 --- a/ckan/ckan/tasks/ckan-plugins.yml +++ b/ckan/ckan/tasks/ckan-plugins.yml @@ -121,7 +121,7 @@ tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ] - name: Download the CKAN LDAP plugin code - git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap force=yes update={{ ckan_git_plugins_state }} editable=True + git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap force=yes update={{ ckan_git_plugins_state }} when: ckan_ldap register: install_ldap_plugin tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ] @@ -133,7 +133,7 @@ tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ] - name: Download the CKAN LIRE plugin code - git: repo={{ ckan_ckanext_lire_url }} dest={{ ckan_virtenv }}/src/ckanext-lire force=yes update={{ ckan_git_plugins_state }} editable=True + git: repo={{ ckan_ckanext_lire_url }} dest={{ ckan_virtenv }}/src/ckanext-lire force=yes update={{ ckan_git_plugins_state }} when: ckan_ckanext_lire register: install_lire_plugin tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ] @@ -163,11 +163,6 @@ notify: Restart CKAN tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ] - # - name: Install a fix for the CKAN google analytics plugin - # get_url: url={{ ckan_google_analytics_fixed_file }} dest=/usr/lib/ckan/default/src/ckanext-googleanalytics/ckanext/googleanalytics/plugin.py force=yes - # when: ckan_google_analytics - # tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ] - - name: Setup the CKAN google analytics plugin shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-googleanalytics ; python setup.py develop when: install_ckan_google_analytics is changed @@ -200,6 +195,18 @@ when: ckan_profiler tags: [ 'ckan', 'ckan_profiler', 'ckan_plugins' ] + - name: Download the CKAN-DATESEARCH plugin code + git: repo={{ ckan_datesearch_url }} dest=/usr/lib/ckan/default/src/ckanext-datesearch force=yes update={{ ckan_git_plugins_state }} + when: ckan_datesearch + register: install_datesearch_plugin + tags: [ 'ckan', 'ckan_datesearch', 'ckan_plugins' ] + + - name: Enable the CKAN-DATESEARCH plugin code + shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-datesearch ; python setup.py develop + when: install_datesearch_plugin is changed + notify: Restart CKAN + tags: [ 'ckan', 'ckan_datesearch', 'ckan_plugins' ] + become: True become_user: '{{ ckan_shell_user }}' tags: [ 'ckan', 'ckan_plugins' ]