This commit is contained in:
Andrea Dell'Amico 2016-11-18 19:08:15 +01:00
parent d38c0147f0
commit 597bb36aa4
2 changed files with 143 additions and 134 deletions

View File

@ -60,6 +60,15 @@ ckan_ldap_fallback: True
ckan_ckanext_lire: False ckan_ckanext_lire: False
ckan_ckanext_lire_n: lire ckan_ckanext_lire_n: lire
ckan_ckanext_lire_url: 'https://github.com/milicp/ckanext-lire.git' ckan_ckanext_lire_url: 'https://github.com/milicp/ckanext-lire.git'
# OAI-PMH
ckan_oai_pmh: False
ckan_oai_pmh_name: oaipmh
ckan_oai_pmh_url: 'https://github.com/kata-csc/ckanext-oaipmh.git'
# Google analytics
ckan_google_analytics: False
ckan_google_analytics_name: googleanalytics
ckan_google_analytics_url: 'git+https://github.com/ckan/ckanext-googleanalytics.git#egg=ckanext-googleanalytics'
# Needed to install some CKAN plugins # Needed to install some CKAN plugins
ckan_additional_packages: ckan_additional_packages:

View File

@ -1,27 +1,22 @@
--- ---
- block:
- name: Install some packages dependencies - name: Install some packages dependencies
become: False become: False
apt: name={{ item }} state=latest update_cache=yes apt: name={{ item }} state=latest update_cache=yes cache_valid_time=3600
with_items: '{{ ckan_additional_packages }}' with_items: '{{ ckan_additional_packages }}'
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
- name: Install some python versioned 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.name }} virtualenv={{ ckan_virtenv }} version={{ item.version }} state={{ item.state }} pip: name={{ item.name }} virtualenv={{ ckan_virtenv }} version={{ item.version }} state={{ item.state }}
with_items: '{{ ckan_pip_versioned_dependencies }}' with_items: '{{ ckan_pip_versioned_dependencies }}'
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
- name: Install some python plugins dependencies inside the CKAN virtualenv - 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 pip: name={{ item }} virtualenv={{ ckan_virtenv }} state=present
with_items: '{{ ckan_pip_dependencies }}' with_items: '{{ ckan_pip_dependencies }}'
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
- name: Download the CKAN ckanext-harvest plugin - name: Download the CKAN ckanext-harvest plugin
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
notify: Restart CKAN notify: Restart CKAN
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
@ -29,22 +24,16 @@
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Download the CKAN ckanext-harvest requirements - 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 }} state={{ ckan_plugins_state }} pip: requirements={{ ckan_virtenv }}/src/ckanext-harvest/pip-requirements.txt virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Initialize the CKAN ckanext-harvest plugin - name: Initialize the CKAN ckanext-harvest plugin
become: True
become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-harvest harvester initdb --config={{ ckan_config_file }} shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-harvest harvester initdb --config={{ ckan_config_file }}
when: ( ckanext_harvest_install | changed ) when: ( ckanext_harvest_install | changed )
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ] tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Download the CKAN ckanext-spatial plugin - name: Download the CKAN ckanext-spatial plugin
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
notify: Restart CKAN notify: Restart CKAN
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
@ -53,30 +42,22 @@
# SQL alchemy cannot be too new. Otherwise it will not work against VDM # SQL alchemy cannot be too new. Otherwise it will not work against VDM
- name: Download the CKAN ckanext-spatial requirements - 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 }} state=present pip: requirements={{ ckan_virtenv }}/src/ckanext-spatial/pip-requirements.txt virtualenv={{ ckan_virtenv }} state=present
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- name: Initialize the CKAN ckanext-spatial plugin - name: Initialize the CKAN ckanext-spatial plugin
become: True
become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-spatial spatial initdb --config={{ ckan_config_file }} shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-spatial spatial initdb --config={{ ckan_config_file }}
when: ( ckanext_spatial_install | changed ) when: ( ckanext_spatial_install | changed )
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- name: Download the CKAN Geonetwork plugin code - name: Download the CKAN Geonetwork plugin code
become: True
become_user: '{{ ckan_shell_user }}'
git: repo={{ ckan_geonetwork_harvester_url }} dest=/usr/lib/ckan/default/src/ckanext-geonetwork git: repo={{ ckan_geonetwork_harvester_url }} dest=/usr/lib/ckan/default/src/ckanext-geonetwork
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
register: install_geonetwork_harvester register: install_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code - name: Install the CKAN Geonetwork plugin code
become: True
become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-geonetwork ; python setup.py develop shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-geonetwork ; python setup.py develop
when: ( install_geonetwork_harvester | changed ) when: ( install_geonetwork_harvester | changed )
notify: Restart CKAN notify: Restart CKAN
@ -93,65 +74,84 @@
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ] tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ]
- name: Download the CKAN PDF viewer plugin - name: Download the CKAN PDF viewer plugin
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_pdfview when: ckan_pdfview
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ]
- name: Download the CKAN Privatedatasets extension - name: Download the CKAN Privatedatasets extension
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_privatedatasets when: ckan_privatedatasets
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ]
- name: Download the CKAN hierarchy plugin code - name: Download the CKAN hierarchy plugin code
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_hierarchy when: ckan_hierarchy
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ]
- name: Download the CKAN pages plugin code - name: Download the CKAN pages plugin code
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_pages when: ckan_pages
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ]
- name: Download the CKAN LDAP plugin code - name: Download the CKAN LDAP plugin code
become: True
become_user: '{{ ckan_shell_user }}'
git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap
when: ckan_ldap when: ckan_ldap
register: install_ldap_plugin register: install_ldap_plugin
tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code - name: Install the CKAN Geonetwork plugin code
become: True
become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ldap ; python setup.py develop shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ldap ; python setup.py develop
when: ( install_ldap_plugin | changed ) when: ( install_ldap_plugin | changed )
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
- name: Download the CKAN LIRE plugin code - name: Download the CKAN LIRE plugin code
become: True
become_user: '{{ ckan_shell_user }}'
git: repo={{ ckan_ckanext_lire_url }} dest={{ ckan_virtenv }}/src/ckanext-lire git: repo={{ ckan_ckanext_lire_url }} dest={{ ckan_virtenv }}/src/ckanext-lire
when: ckan_ckanext_lire when: ckan_ckanext_lire
register: install_lire_plugin register: install_lire_plugin
tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code - name: Install the CKAN Geonetwork plugin code
become: True
become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; cd {{ ckan_virtenv }}/src/ckanext-lire ; pip install -e ./ shell: . /usr/lib/ckan/default/bin/activate ; cd {{ ckan_virtenv }}/src/ckanext-lire ; pip install -e ./
when: ( install_lire_plugin | changed ) when: ( install_lire_plugin | changed )
notify: Restart CKAN notify: Restart CKAN
tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ] tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ]
- name: Download the CKAN OAI-PMH plugin
git: repo={{ ckan_oai_pmh_url }} dest=/usr/lib/ckan/default/src/ckanext-oaipmh
when: ckan_oai_pmh
register: install_ckan_oai_pmh
tags: [ 'ckan', 'ckan_oai_pmh', 'ckan_plugins' ]
- name: Setup the CKAN OAI-PMH plugin
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-oaipmh ; python setup.py develop
when: ( install_ckan_oai_pmh | changed )
notify: Restart CKAN
tags: [ 'ckan', 'ckan_oai_pmh', 'ckan_plugins' ]
- name: Download the CKAN google analytics plugin python requirements
pip: name='genshi' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_google_analytics
notify: Restart CKAN
tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ]
- name: Download the CKAN google analytics plugin
pip: name='{{ ckan_google_analytics_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
when: ckan_google_analytics
register: install_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 | changed )
notify: Restart CKAN
tags: [ 'ckan', 'ckan_oai_pmh', 'ckan_plugins' ]
become: True
become_user: '{{ ckan_shell_user }}'
tags: [ 'ckan', 'ckan_plugins' ]