Add a task to fix some permissions

This commit is contained in:
Andrea Dell'Amico 2023-06-28 10:54:21 +02:00
parent 959b176fd0
commit 7fcc272c29
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 30 additions and 16 deletions

View File

@ -1,14 +1,11 @@
galaxy_info:
namespace: adellam
role_name: ckan
author: Andrea Dell'Amico
description: Systems Architect
description: Ansible role that installs CKAN, <https://www.ckan.org>, and a bunch of plugins.
company: ISTI-CNR
issue_tracker_url: https://redmine-s2i2s.isti.cnr.it/projects/provisioning
license: EUPL 1.2+
min_ansible_version: 2.8
min_ansible_version: "2.8"
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#

View File

@ -1,15 +1,36 @@
---
- block:
- name: Package dependencies
tags: ['ckan', 'geonetwork', 'ckan_plugins', 'ckan_pip_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
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
@ -287,7 +308,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' ]