From ceedd93a0e02931745d99779ad129db92076cb28 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 16 Nov 2016 15:30:15 +0100 Subject: [PATCH] library/roles/ckan: Fix the SQLalchemy version, because the newest is not supported by the spatial plugin. d4science-ghn-cluster: ckan dev, do not install the hierarchy changes. --- ckan/ckan/defaults/main.yml | 6 ++++++ ckan/ckan/tasks/ckan-plugins.yml | 28 ++++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ckan/ckan/defaults/main.yml b/ckan/ckan/defaults/main.yml index 5b27da3f..88f4e3a6 100644 --- a/ckan/ckan/defaults/main.yml +++ b/ckan/ckan/defaults/main.yml @@ -25,6 +25,8 @@ ckan_logdir: /var/log/ckan ckan_db_name: ckan ckan_db_user: ckan +# CKAN plugins +ckan_plugins_state: latest # Order is important ckan_geonetwork_harvester: False ckan_ckanext_harvester_url: 'git+https://github.com/ckan/ckanext-harvest.git#egg=ckanext-harvest' @@ -81,6 +83,10 @@ ckan_pip_dependencies: - rdflib - 'urllib3[secure]' - bleach + +ckan_pip_versioned_dependencies: + - { name: 'SQLAlchemy', version: '0.9.6', state: 'present' } + # apache_additional_packages: - libapache2-mod-uwsgi diff --git a/ckan/ckan/tasks/ckan-plugins.yml b/ckan/ckan/tasks/ckan-plugins.yml index 9963be26..402b9fdd 100644 --- a/ckan/ckan/tasks/ckan-plugins.yml +++ b/ckan/ckan/tasks/ckan-plugins.yml @@ -5,17 +5,24 @@ with_items: '{{ ckan_additional_packages }}' tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] -- name: Install some plugins dependencies inside the CKAN virtualenv +- name: Install some python versioned plugins dependencies inside the CKAN virtualenv become: True become_user: '{{ ckan_shell_user }}' - pip: name={{ item }} virtualenv={{ ckan_virtenv }} state=latest + pip: name={{ item.name }} virtualenv={{ ckan_virtenv }} version={{ item.version }} state={{ item.state }} + with_items: '{{ ckan_pip_versioned_dependencies }}' + tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] + +- name: Install some python plugins dependencies inside the CKAN virtualenv + become: True + become_user: '{{ ckan_shell_user }}' + pip: name={{ item }} virtualenv={{ ckan_virtenv }} state=present with_items: '{{ ckan_pip_dependencies }}' tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] - name: Download the CKAN ckanext-harvest plugin become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN when: ckan_geonetwork_harvester register: ckanext_harvest_install @@ -24,7 +31,7 @@ - name: Download the CKAN ckanext-harvest requirements become: True become_user: '{{ ckan_shell_user }}' - pip: requirements={{ ckan_virtenv }}/src/ckanext-harvest/pip-requirements.txt virtualenv={{ ckan_virtenv }} + pip: requirements={{ ckan_virtenv }}/src/ckanext-harvest/pip-requirements.txt virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_geonetwork_harvester tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ] @@ -38,16 +45,17 @@ - name: Download the CKAN ckanext-spatial plugin become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN when: ckan_geonetwork_harvester register: ckanext_spatial_install tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ] +# SQL alchemy cannot be too new. Otherwise it will not work against VDM - name: Download the CKAN ckanext-spatial requirements become: True become_user: '{{ ckan_shell_user }}' - pip: requirements={{ ckan_virtenv }}/src/ckanext-spatial/pip-requirements.txt virtualenv={{ ckan_virtenv }} + pip: requirements={{ ckan_virtenv }}/src/ckanext-spatial/pip-requirements.txt virtualenv={{ ckan_virtenv }} state=present when: ckan_geonetwork_harvester tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ] @@ -87,7 +95,7 @@ - name: Download the CKAN PDF viewer plugin become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_pdfview notify: Restart CKAN tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ] @@ -95,7 +103,7 @@ - name: Download the CKAN Privatedatasets extension become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_privatedatasets notify: Restart CKAN tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ] @@ -103,7 +111,7 @@ - name: Download the CKAN hierarchy plugin code become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_hierarchy notify: Restart CKAN tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ] @@ -111,7 +119,7 @@ - name: Download the CKAN pages plugin code become: True become_user: '{{ ckan_shell_user }}' - pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} + pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_pages notify: Restart CKAN tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ]