ansible-roles/tomcat-multiple-instances/templates/tomcat-default.j2

62 lines
2.8 KiB
Plaintext
Raw Normal View History

TOMCAT_USER={{ item.user }}
TOMCAT_GROUP={{ item.user }}
JAVA_HOME={{ item.java_home }}
JAVA_OPTS="-server -Djava.awt.headless=true"
{% if item.java_heap is defined %}
JAVA_HEAP="{{ item.java_heap }}"
{% else %}
JAVA_HEAP="{{ tomcat_m_java_opts_heap }}"
{% endif %}
JAVA_PERMGEN=
{% if jdk_default <= 7 %}
{% if item.java_permgen_size is defined %}
JAVA_PERMGEN="-XX:MaxPermSize={{ item.java_permgen_size }}"
{% else %}
JAVA_PERMGEN="-XX:MaxPermSize={{ tomcat_m_permgen_size }}"
{% endif %}
{% endif %}
{% if item.java_opts is defined %}
JAVA_OPTS="{{ item.java_opts }} $JAVA_OPTS $JAVA_HEAP $JAVA_PERMGEN"
{% endif %}
{% if item.java_gc_opts is defined %}
JAVA_OPTS="{{ item.java_gc_opts }} $JAVA_OPTS"
{% endif %}
{% if item.other_java_opts is defined %}
JAVA_OPTS="${JAVA_OPTS} {{ item.other_java_opts }}"
{% endif %}
{% if item.jmx_enabled is defined and item.jmx_enabled %}
# JMX settings
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port={{ item.jmx_port | default('8186') }}"
{% if item.jmx_use_ssl is defined and item.jmx_use_ssl %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=true"
{% else %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
{% endif %}
{% if item.jmx_localhost_only is defined and item.jmx_localhost_only %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.local.only=true -Djava.rmi.server.hostname=127.0.0.1"
{% else %}
JAVA_OPTS="${JAVA_OPTS} -Djava.rmi.server.hostname={{ tomcat_m_jmx_ip_address }}"
{% endif %}
{% if item.jmx_auth_enabled is defined and item.jmx_auth_enabled %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file={{ item.jmx_auth_dir }}/jmxremote.password -Dcom.sun.management.jmxremote.access.file={{ item.jmx_auth_dir }}/jmxremote.access"
{% else %}
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
{% endif %}
{% if item.jmx_disable_additional_ports is defined and item.jmx_disable_additional_ports %}
JAVA_OPTS="${JAVA_OPTS} -XX:+DisableAttachMechanism -Dcom.sun.management.jmxremote.rmi.port={{ item.jmx_port }}"
{% endif %}
{% endif %}
{% if item.remote_debugging is defined and item.remote_debugging %}
# You will be able to use a java debugger on port {{ item.remote_debugging_port }}.
JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,address={{ item.remote_debugging_port }},server=y,suspend=n"
{% endif %}
# WARNING: This directory will be destroyed and recreated at every startup !
JVM_TMP={{ item.instance_path }}/tmp
{% if item.catalina_tmp_directory is defined %}
export CATALINA_TMPDIR={{ item.catalina_tmp_directory }}
{% endif %}
# Additional options not managed by the provisioning tools
if [ -f /etc/default/tomcat-instance-{{ item.http_port }}.local ] ; then
. /etc/default/tomcat-instance-{{ item.http_port }}.local
fi