ansible-roles/ckan/ckan/tasks/ckan-plugins.yml

145 lines
6.3 KiB
YAML

---
- name: Install some plugins dependencies inside the CKAN virtualenv
become: True
become_user: '{{ ckan_shell_user }}'
pip: name={{ item }} virtualenv={{ ckan_virtenv }}
with_items: '{{ ckan_pip_dependencies }}'
when: ckan_geonetwork_harvester
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 }}
notify: Restart CKAN
when: ckan_geonetwork_harvester
register: ckanext_harvest_install
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- 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 }}
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- 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 }}
when: ( ckanext_harvest_install | changed )
tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ]
- name: Download the CKAN ckanext-spatial plugin
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_ckanext_spatial_url }}' virtualenv={{ ckan_virtenv }}
notify: Restart CKAN
when: ckan_geonetwork_harvester
register: ckanext_spatial_install
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- 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 }}
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- 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 }}
when: ( ckanext_spatial_install | changed )
tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ]
- 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
when: ckan_geonetwork_harvester
register: install_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
- 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
when: ( install_geonetwork_harvester | changed )
notify: Restart CKAN
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ]
- 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
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ]
- 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 }}
when: ckan_geonetwork_harvester
tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins', 'tracker' ]
- name: Download the CKAN PDF viewer plugin
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_ckanext_pdfview_url }}' virtualenv={{ ckan_virtenv }}
when: ckan_pdfview
notify: Restart CKAN
tags: [ 'ckan', 'ckan_pdfview', 'ckan_plugins' ]
- name: Download the CKAN Privatedatasets extension
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_privatedatasets_url }}' virtualenv={{ ckan_virtenv }}
when: ckan_privatedatasets
notify: Restart CKAN
tags: [ 'ckan', 'ckan_privdatasets', 'ckan_plugins' ]
- name: Download the CKAN hierarchy plugin code
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_hierarchy_url }}' virtualenv={{ ckan_virtenv }}
when: ckan_hierarchy
notify: Restart CKAN
tags: [ 'ckan', 'ckan_hierarchy', 'ckan_plugins' ]
- name: Download the CKAN pages plugin code
become: True
become_user: '{{ ckan_shell_user }}'
pip: name='{{ ckan_pages_url }}' virtualenv={{ ckan_virtenv }}
when: ckan_pages
notify: Restart CKAN
tags: [ 'ckan', 'ckan_pages', 'ckan_plugins' ]
- 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
when: ckan_ldap
register: install_ldap_plugin
tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
- 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
when: ( install_ldap_plugin | changed )
notify: Restart CKAN
tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ]
# - name: Overwrite the base.py ckanext-spatial plugin file to enable authentication against the Geonetwork nodes
# copy: src=base.py dest=/usr/lib/ckan/default/src/ckanext-spatial/ckanext/spatial/harvesters/base.py owner={{ ckan_shell_user }} group={{ ckan_shell_user }} mode=0644 backup=yes
# notify: Restart CKAN
# tags: [ 'ckan', 'ckan_pages', 'ckan_plugins', 'ckan_geo_auth' ]
# - name: Overwrite the ckanharvester.py ckanext plugin file to remove the authentication data from URLs
# copy: src=ckanharvester.py dest=/usr/lib/ckan/default/src/ckanext-harvest/ckanext/harvest/harvesters/ckanharvester.py owner={{ ckan_shell_user }} group={{ ckan_shell_user }} mode=0644 backup=yes
# notify: Restart CKAN
# tags: [ 'ckan', 'ckan_pages', 'ckan_plugins', 'ckan_ckanharvester' ]
# - name: Overwrite the csw.py ckanext-spatial plugin file to remove the authentication data from URLs
# copy: src=csw.py dest=/usr/lib/ckan/default/src/ckanext-spatial/ckanext/spatial/harvesters/csw.py owner={{ ckan_shell_user }} group={{ ckan_shell_user }} mode=0644 backup=yes
# notify: Restart CKAN
# tags: [ 'ckan', 'ckan_pages', 'ckan_plugins', 'ckan_ckanext_spatial' ]