library/roles/ckan/ckan: Manage the installation of the GA report plugin.

d4science-ghn-cluster:  CKAN dev: install the GA report plugin.
This commit is contained in:
Andrea Dell'Amico 2016-11-21 15:39:53 +01:00
parent 597bb36aa4
commit f7f909249f
2 changed files with 16 additions and 1 deletions

View File

@ -68,6 +68,10 @@ ckan_oai_pmh_url: 'https://github.com/kata-csc/ckanext-oaipmh.git'
ckan_google_analytics: False ckan_google_analytics: False
ckan_google_analytics_name: googleanalytics ckan_google_analytics_name: googleanalytics
ckan_google_analytics_url: 'git+https://github.com/ckan/ckanext-googleanalytics.git#egg=ckanext-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 # Needed to install some CKAN plugins

View File

@ -149,8 +149,19 @@
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-googleanalytics ; python setup.py develop 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 ) when: ( install_ckan_google_analytics | changed )
notify: Restart CKAN 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: True
become_user: '{{ ckan_shell_user }}' become_user: '{{ ckan_shell_user }}'