From f7f909249f0dbb52f5ecc94029fa083bc8cc1d1e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 21 Nov 2016 15:39:53 +0100 Subject: [PATCH] library/roles/ckan/ckan: Manage the installation of the GA report plugin. d4science-ghn-cluster: CKAN dev: install the GA report plugin. --- ckan/ckan/defaults/main.yml | 4 ++++ ckan/ckan/tasks/ckan-plugins.yml | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ckan/ckan/defaults/main.yml b/ckan/ckan/defaults/main.yml index 9aff8eb6..8f1e46c1 100644 --- a/ckan/ckan/defaults/main.yml +++ b/ckan/ckan/defaults/main.yml @@ -68,6 +68,10 @@ ckan_oai_pmh_url: 'https://github.com/kata-csc/ckanext-oaipmh.git' ckan_google_analytics: False ckan_google_analytics_name: googleanalytics ckan_google_analytics_url: 'git+https://github.com/ckan/ckanext-googleanalytics.git#egg=ckanext-googleanalytics' +# Google analytics reports +ckan_ga_reports: False +ckan_ga_reports_name: ga-report +ckan_ga_reports_url: 'git+https://github.com/datagovuk/ckanext-ga-report.git#egg=ckanext-ga-report' # Needed to install some CKAN plugins diff --git a/ckan/ckan/tasks/ckan-plugins.yml b/ckan/ckan/tasks/ckan-plugins.yml index 9ae42045..f202970e 100644 --- a/ckan/ckan/tasks/ckan-plugins.yml +++ b/ckan/ckan/tasks/ckan-plugins.yml @@ -149,8 +149,19 @@ shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-googleanalytics ; python setup.py develop when: ( install_ckan_google_analytics | changed ) notify: Restart CKAN - tags: [ 'ckan', 'ckan_oai_pmh', 'ckan_plugins' ] + tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ] + - name: Download the CKAN google analytics reports plugin + pip: name='{{ ckan_ga_reports_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} + when: ckan_ga_reports + register: install_ckan_ga_reports + tags: [ 'ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins' ] + + - name: Setup the CKAN google analytics reports plugin + shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ga-report ; paster initdb --config={{ ckan_config_file }} + when: ( install_ckan_ga_reports | changed ) + notify: Restart CKAN + tags: [ 'ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins' ] become: True become_user: '{{ ckan_shell_user }}'