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' ] +