|
|
|
@ -1,15 +1,37 @@
|
|
|
|
|
---
|
|
|
|
|
- block:
|
|
|
|
|
- name: Package dependencies
|
|
|
|
|
tags: ['ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_pkg_deps']
|
|
|
|
|
block:
|
|
|
|
|
- name: Install some packages dependencies
|
|
|
|
|
apt: name={{ ckan_additional_packages }} state=latest update_cache=yes cache_valid_time=3600
|
|
|
|
|
ansible.builtin.apt:
|
|
|
|
|
name: "{{ ckan_additional_packages }}"
|
|
|
|
|
state: latest
|
|
|
|
|
update_cache: true
|
|
|
|
|
cache_valid_time: 3600
|
|
|
|
|
|
|
|
|
|
tags: [ 'ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps' ]
|
|
|
|
|
- name: Fix the permissions of "{{ ckan_virtenv }}/src/"
|
|
|
|
|
tags: [ckan, ckan_plugins, ckan_src_permissions]
|
|
|
|
|
block:
|
|
|
|
|
- name: Ensure that everything under "{{ ckan_virtenv }}/src/" is owned by "{{ ckan_shell_user }}"
|
|
|
|
|
ansible.builtin.file:
|
|
|
|
|
path: "{{ item }}"
|
|
|
|
|
state: directory
|
|
|
|
|
recurse: true
|
|
|
|
|
owner: "{{ ckan_shell_user }}"
|
|
|
|
|
group: "{{ ckan_shell_user }}"
|
|
|
|
|
loop:
|
|
|
|
|
- "/usr/lib/ckan/default/lib/python2.7/site-packages"
|
|
|
|
|
- "{{ ckan_virtenv }}/src/"
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: CKAN plugins management
|
|
|
|
|
become: true
|
|
|
|
|
become_user: '{{ ckan_shell_user }}'
|
|
|
|
|
tags: ['ckan', 'ckan_plugins']
|
|
|
|
|
block:
|
|
|
|
|
- name: Install some python versioned plugins dependencies inside the CKAN virtualenv
|
|
|
|
|
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' ]
|
|
|
|
|
tags: ['ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_deps']
|
|
|
|
|
|
|
|
|
|
- name: Install some python plugins dependencies inside the CKAN virtualenv
|
|
|
|
|
pip: name={{ ckan_pip_dependencies }} virtualenv={{ ckan_virtenv }} state=present
|
|
|
|
@ -227,19 +249,25 @@
|
|
|
|
|
when: ckan_google_analytics | bool
|
|
|
|
|
register: install_ckan_google_analytics
|
|
|
|
|
notify: Restart CKAN
|
|
|
|
|
tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ]
|
|
|
|
|
tags: ['ckan', 'ckan_google_analytics', 'ckan_plugins']
|
|
|
|
|
|
|
|
|
|
- name: Install the CKAN Google Analytics plugin requirements
|
|
|
|
|
pip: requirements={{ ckan_virtenv }}/src/ckanext-googleanalytics/requirements.txt virtualenv={{ ckan_virtenv }} state=present
|
|
|
|
|
when: ckan_google_analytics | bool
|
|
|
|
|
notify: Restart CKAN
|
|
|
|
|
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 is changed
|
|
|
|
|
notify: Restart CKAN
|
|
|
|
|
tags: [ 'ckan', 'ckan_google_analytics', '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=present editable=True
|
|
|
|
|
when: ckan_ga_reports | bool
|
|
|
|
|
register: install_ckan_ga_reports
|
|
|
|
|
tags: [ 'ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins' ]
|
|
|
|
|
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 }}
|
|
|
|
@ -247,7 +275,7 @@
|
|
|
|
|
- install_ckan_ga_reports is changed
|
|
|
|
|
- ckan_init_db_and_solr | bool
|
|
|
|
|
notify: Restart CKAN
|
|
|
|
|
tags: [ 'ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins' ]
|
|
|
|
|
tags: ['ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins']
|
|
|
|
|
|
|
|
|
|
- name: Download the CKAN star ratings plugin
|
|
|
|
|
pip: name='{{ ckan_star_ratings_url }}' virtualenv={{ ckan_virtenv }} editable=true state={{ ckan_star_ratings_state }}
|
|
|
|
@ -287,7 +315,3 @@
|
|
|
|
|
when: install_datesearch_plugin is changed
|
|
|
|
|
notify: Restart CKAN
|
|
|
|
|
tags: [ 'ckan', 'ckan_datesearch', 'ckan_plugins' ]
|
|
|
|
|
|
|
|
|
|
become: True
|
|
|
|
|
become_user: '{{ ckan_shell_user }}'
|
|
|
|
|
tags: [ 'ckan', 'ckan_plugins' ]
|
|
|
|
|