Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CATALINA_OPTS in setenv.sh for example for remote jmx monitoring #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ This example is taken from `molecule/resources/converge.yml` and is tested on ea
ajp_port: 8017
libs:
- url: "https://search.maven.org/remotecontent?filepath=io/prometheus/simpleclient/0.6.0/simpleclient-0.6.0.jar"
- name: "tomcat-with-jmx"
shutdown_port: 8023
non_ssl_connector_port: 8088
ssl_connector_port: 8450
ajp_port: 8017
catalina_opts: >-
-Dcom.sun.management.jmxremote.port=8375
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=jmx.1.1.1.10.nip.io
- name: "tomcat-access-logs"
shutdown_port: 8024
non_ssl_connector_port: 8089
Expand Down
2 changes: 1 addition & 1 deletion tasks/instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
dest: "{{ tomcat_directory }}/{{ instance.name }}/bin/setenv.sh"
mode: "0644"
when:
- (instance.java_opts is defined) or (instance.xms is defined) or (instance.xmx is defined)
- (instance.java_opts is defined) or (instance.xms is defined) or (instance.xmx is defined) or (instance.catalina_opts is defined)
notify:
- restart tomcat instance

Expand Down
4 changes: 4 additions & 0 deletions templates/setenv.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ JAVA_OPTS="-Xms{{ instance.xms }} ${JAVA_OPTS}"
{% else %}
JAVA_OPTS="-Xms{{ tomcat_xms }} ${JAVA_OPTS}"
{% endif %}

{% if instance.catalina_opts is defined %}
CATALINA_OPTS="{{ instance.catalina_opts }}"
{% endif %}