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,157 +1,157 @@
--- ---
- name: Install some packages dependencies - block:
become: False - name: Install some packages dependencies
apt: name={{ item }} state=latest update_cache=yes become: False
with_items: '{{ ckan_additional_packages }}' apt: name={{ item }} state=latest update_cache=yes cache_valid_time=3600
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ] with_items: '{{ ckan_additional_packages }}'
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 pip: name={{ item.name }} virtualenv={{ ckan_virtenv }} version={{ item.version }} state={{ item.state }}
become_user: '{{ ckan_shell_user }}' with_items: '{{ ckan_pip_versioned_dependencies }}'
pip: name={{ item.name }} virtualenv={{ ckan_virtenv }} version={{ item.version }} state={{ item.state }} tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
with_items: '{{ ckan_pip_versioned_dependencies }}'
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 pip: name={{ item }} virtualenv={{ ckan_virtenv }} state=present
become_user: '{{ ckan_shell_user }}' with_items: '{{ ckan_pip_dependencies }}'
pip: name={{ item }} virtualenv={{ ckan_virtenv }} state=present tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
with_items: '{{ ckan_pip_dependencies }}'
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
- name: Download the CKAN ckanext-harvest plugin - name: Download the CKAN ckanext-harvest plugin
become: True pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' notify: Restart CKAN
pip: name='{{ ckan_ckanext_harvester_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_geonetwork_harvester
notify: Restart CKAN register: ckanext_harvest_install
when: ckan_geonetwork_harvester tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
register: ckanext_harvest_install
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Download the CKAN ckanext-harvest requirements - name: Download the CKAN ckanext-harvest requirements
become: True pip: requirements={{ ckan_virtenv }}/src/ckanext-harvest/pip-requirements.txt virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' when: ckan_geonetwork_harvester
pip: requirements={{ ckan_virtenv }}/src/ckanext-harvest/pip-requirements.txt virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Initialize the CKAN ckanext-harvest plugin - name: Initialize the CKAN ckanext-harvest plugin
become: True shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-harvest harvester initdb --config={{ ckan_config_file }}
become_user: '{{ ckan_shell_user }}' when: ( ckanext_harvest_install | changed )
shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-harvest harvester initdb --config={{ ckan_config_file }} tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
when: ( ckanext_harvest_install | changed )
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Download the CKAN ckanext-spatial plugin - name: Download the CKAN ckanext-spatial plugin
become: True pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' notify: Restart CKAN
pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} when: ckan_geonetwork_harvester
notify: Restart CKAN register: ckanext_spatial_install
when: ckan_geonetwork_harvester tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
register: ckanext_spatial_install
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
# 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 pip: requirements={{ ckan_virtenv }}/src/ckanext-spatial/pip-requirements.txt virtualenv={{ ckan_virtenv }} state=present
become_user: '{{ ckan_shell_user }}' when: ckan_geonetwork_harvester
pip: requirements={{ ckan_virtenv }}/src/ckanext-spatial/pip-requirements.txt virtualenv={{ ckan_virtenv }} state=present tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- name: Initialize the CKAN ckanext-spatial plugin - name: Initialize the CKAN ckanext-spatial plugin
become: True shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-spatial spatial initdb --config={{ ckan_config_file }}
become_user: '{{ ckan_shell_user }}' when: ( ckanext_spatial_install | changed )
shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-spatial spatial initdb --config={{ ckan_config_file }} tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
when: ( ckanext_spatial_install | changed )
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- name: Download the CKAN Geonetwork plugin code - name: Download the CKAN Geonetwork plugin code
become: True git: repo={{ ckan_geonetwork_harvester_url }} dest=/usr/lib/ckan/default/src/ckanext-geonetwork
become_user: '{{ ckan_shell_user }}' when: ckan_geonetwork_harvester
git: repo={{ ckan_geonetwork_harvester_url }} dest=/usr/lib/ckan/default/src/ckanext-geonetwork register: install_geonetwork_harvester
when: ckan_geonetwork_harvester tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
register: install_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code - name: Install the CKAN Geonetwork plugin code
become: True shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-geonetwork ; python setup.py develop
become_user: '{{ ckan_shell_user }}' when: ( install_geonetwork_harvester | changed )
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-geonetwork ; python setup.py develop notify: Restart CKAN
when: ( install_geonetwork_harvester | changed ) tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
notify: Restart CKAN
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
- name: Install the script that updates the tracking data - name: Install the script that updates the tracking data
template: src=tracker_update.sh.j2 dest={{ ckan_virtenv }}/bin/tracker_update owner={{ ckan_shell_user }} group={{ ckan_shell_user }} mode=0555 template: src=tracker_update.sh.j2 dest={{ ckan_virtenv }}/bin/tracker_update owner={{ ckan_shell_user }} group={{ ckan_shell_user }} mode=0555
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ] tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ]
- name: Install the cron job that runs the tracker update script - name: Install the cron job that runs the tracker update script
cron: name="tracker update" minute="0" hour="3" job="{{ ckan_virtenv }}/bin/tracker_update > {{ ckan_logdir }}/tracker_update.log 2>&1" user={{ ckan_shell_user }} cron: name="tracker update" minute="0" hour="3" job="{{ ckan_virtenv }}/bin/tracker_update > {{ ckan_logdir }}/tracker_update.log 2>&1" user={{ ckan_shell_user }}
when: ckan_geonetwork_harvester when: ckan_geonetwork_harvester
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 pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' when: ckan_pdfview
pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN
when: ckan_pdfview tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ]
notify: Restart CKAN
tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ]
- name: Download the CKAN Privatedatasets extension - name: Download the CKAN Privatedatasets extension
become: True pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' when: ckan_privatedatasets
pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN
when: ckan_privatedatasets tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ]
notify: Restart CKAN
tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ]
- name: Download the CKAN hierarchy plugin code - name: Download the CKAN hierarchy plugin code
become: True pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' when: ckan_hierarchy
pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN
when: ckan_hierarchy tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ]
notify: Restart CKAN
tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ]
- name: Download the CKAN pages plugin code - name: Download the CKAN pages plugin code
become: True pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }}
become_user: '{{ ckan_shell_user }}' when: ckan_pages
pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }} state={{ ckan_plugins_state }} notify: Restart CKAN
when: ckan_pages tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ]
notify: Restart CKAN
tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ]
- name: Download the CKAN LDAP plugin code - name: Download the CKAN LDAP plugin code
become: True git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap
become_user: '{{ ckan_shell_user }}' when: ckan_ldap
git: repo={{ ckan_ldap_url }} dest=/usr/lib/ckan/default/src/ckanext-ldap register: install_ldap_plugin
when: ckan_ldap tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
register: install_ldap_plugin
tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code - name: Install the CKAN Geonetwork plugin code
become: True shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ldap ; python setup.py develop
become_user: '{{ ckan_shell_user }}' when: ( install_ldap_plugin | changed )
shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ldap ; python setup.py develop notify: Restart CKAN
when: ( install_ldap_plugin | changed ) tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
notify: Restart CKAN
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
when: ckan_ckanext_lire
register: install_lire_plugin
tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code
shell: . /usr/lib/ckan/default/bin/activate ; cd {{ ckan_virtenv }}/src/ckanext-lire ; pip install -e ./
when: ( install_lire_plugin | changed )
notify: Restart CKAN
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' ]
- 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
when: ckan_ckanext_lire
register: install_lire_plugin
tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ]
- name: Install the CKAN Geonetwork plugin code
become: True become: True
become_user: '{{ ckan_shell_user }}' become_user: '{{ ckan_shell_user }}'
shell: . /usr/lib/ckan/default/bin/activate ; cd {{ ckan_virtenv }}/src/ckanext-lire ; pip install -e ./ tags: [ 'ckan', 'ckan_plugins' ]
when: ( install_lire_plugin | changed )
notify: Restart CKAN
tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ]