Skip to content

Commit 1d0cab2

Browse files
authored
Merge pull request #15 from rhythmictech/FEC-3922
FEC-3922 - Suppress stack trace in Tomcat error responses
2 parents 42c470f + 4ec371a commit 1d0cab2

7 files changed

Lines changed: 23 additions & 4 deletions

File tree

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ tomcat_umask: '0022'
3737
tomcat_add_user_to_group: false
3838
tomcat_unit_file_overrides: []
3939

40+
tomcat_suppress_error_reports: true
41+
4042
# This will be randomly generated every ansible run if not set
4143
tomcat_shutdown_value: 'SETME'
4244

meta/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22

33
galaxy_info:
4+
role_name: tomcat
5+
namespace: rhythmictech
46
author: Rhythmic Open Source <opensource@rhythmictech.com>
57
description: Ansible Role for Apache Tomcat
68
company: Rhythmic Technologies, Inc.

molecule/default/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
tasks:
88
- name: "Include ansible-role-tomcat"
99
include_role:
10-
name: "ansible-role-tomcat"
10+
name: "rhythmictech.tomcat"

molecule/default/molecule.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ driver:
55
name: docker
66
platforms:
77
- name: instance
8-
image: docker.io/pycontribs/centos:7
8+
image: docker.io/geerlingguy/docker-amazonlinux2023-ansible
99
pre_build_image: true
10-
command: /sbin/init
10+
command: /usr/lib/systemd/systemd
1111
tmpfs:
1212
- /run
1313
- /tmp
1414
volumes:
15-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
15+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
16+
cgroupns_mode: host
17+
privileged: true
1618
provisioner:
1719
name: ansible
1820
verifier:

molecule/default/prepare.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: Prepare
3+
hosts: all
4+
tasks:
5+
- name: ensure tar is installed
6+
ansible.builtin.package:
7+
name: tar
8+
state: present

tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- name: give tomcat group access to read all in CATALINA_HOME
3636
command: "find {{ _tomcat_catalina_home }}/ -exec /bin/chgrp {{ tomcat_group }} {} \\;"
3737
tags: ['tomcat']
38+
changed_when: false
3839

3940
- name: restrict access to CATALINA_HOME
4041
file: path="{{ _tomcat_catalina_home }}" state=directory owner="root" group="{{ tomcat_group }}" mode='0750'

templates/catalina_base.conf.server.xml.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
{% endif %}
4848
{% if tomcat_rewrite_rules|length > 0 %}
4949
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
50+
{% endif %}
51+
{% if tomcat_suppress_error_reports %}
52+
<Valve className="org.apache.catalina.valves.ErrorReportValve"
53+
showReport="false" showServerInfo="false" />
5054
{% endif %}
5155
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
5256
prefix="localhost_access_log" suffix=".txt"

0 commit comments

Comments
 (0)