From 3ccfd6424a152a98a479ffef19b7195e7ebad44e Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 2 May 2018 12:00:57 +0200 Subject: [PATCH] Give the gcube user the possibility to write into the nginx root directory. --- smartgears/smartgears-nginx-frontend/defaults/main.yml | 1 + smartgears/smartgears-nginx-frontend/tasks/main.yml | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/smartgears/smartgears-nginx-frontend/defaults/main.yml b/smartgears/smartgears-nginx-frontend/defaults/main.yml index 56d03969..bd513750 100644 --- a/smartgears/smartgears-nginx-frontend/defaults/main.yml +++ b/smartgears/smartgears-nginx-frontend/defaults/main.yml @@ -11,3 +11,4 @@ smartgears_tomcat_manager_access_acls: - { policy: 'allow', address: '0.0.0.0/0' } smartgears_nginx_expose_tomcat_logs: False +smartgears_nginx_rw_html_root: False diff --git a/smartgears/smartgears-nginx-frontend/tasks/main.yml b/smartgears/smartgears-nginx-frontend/tasks/main.yml index faed2dd2..e67ffab5 100644 --- a/smartgears/smartgears-nginx-frontend/tasks/main.yml +++ b/smartgears/smartgears-nginx-frontend/tasks/main.yml @@ -32,3 +32,10 @@ notify: Reload nginx tags: [ 'nginx', 'virtualhost' ] +- name: Give the smartgears user access to the document root, and create it if needed + file: dest={{ item.web_document_root}} state=directory owner={{ item.user }} group={{ item.user }} mode=0755 + with_items: '{{ tomcat_m_instances }}' + when: smartgears_nginx_rw_html_root + notify: Reload nginx + tags: [ 'nginx', 'virtualhost', 'web_root' ] +