diff --git a/defaults/main.yml b/defaults/main.yml index 8b79df3..1b3bfb4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 701e677..fc87b8d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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