Group ownership to www-data for the log directory when requested.

This commit is contained in:
Andrea Dell'Amico 2020-08-06 17:30:25 +02:00
parent d226826ce8
commit 2207a272eb
2 changed files with 9 additions and 0 deletions

View File

@ -28,6 +28,7 @@ tomcat_m_manager_status_r: "manager-status"
tomcat_m_instances_base_path: '/var/lib/tomcat_instances'
tomcat_m_instances_logdir_base: '/var/log/tomcat_instances'
tomcat_m_expose_log_directory: False
tomcat_m_cache_base: '/var/cache/tomcat-instances'
tomcat_m_default_user: 'tomcat{{ tomcat_version }}'
tomcat_m_use_default_user: True

View File

@ -36,6 +36,14 @@
file: dest={{ tomcat_m_instances_logdir_base }}/{{ item.http_port }} owner={{ item.user }} group={{ item.user }} mode='0750' state=directory
with_items: '{{ tomcat_m_instances }}'
register: tomcat_first_install
when: not tomcat_m_expose_log_directory
tags: [ 'tomcat', 'tomcat_instances', 'tomcat_log_dir' ]
- name: Create log dirs, readable by the user that runs the http service
file: dest={{ tomcat_m_instances_logdir_base }}/{{ item.http_port }} owner={{ item.user }} group='www-data' mode='0750' state=directory
with_items: '{{ tomcat_m_instances }}'
register: tomcat_first_install
when: tomcat_m_expose_log_directory
tags: [ 'tomcat', 'tomcat_instances', 'tomcat_log_dir' ]
- name: Create the instances work dirs