Skip to content

Commit d95a1ca

Browse files
authored
Merge pull request #477 from bwitt/add-jvm-route
Add jvm_route param
2 parents 4db0cb0 + 60c54c4 commit d95a1ca

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ The following parameters are available in the `jira` class:
139139
* [`tomcat_address`](#-jira--tomcat_address)
140140
* [`tomcat_port`](#-jira--tomcat_port)
141141
* [`tomcat_shutdown_port`](#-jira--tomcat_shutdown_port)
142+
* [`jvm_route`](#-jira--jvm_route)
142143
* [`tomcat_max_http_header_size`](#-jira--tomcat_max_http_header_size)
143144
* [`tomcat_min_spare_threads`](#-jira--tomcat_min_spare_threads)
144145
* [`tomcat_connection_timeout`](#-jira--tomcat_connection_timeout)
@@ -832,6 +833,14 @@ Tomcat shutdown command port
832833

833834
Default value: `8005`
834835

836+
##### <a name="-jira--jvm_route"></a>`jvm_route`
837+
838+
Data type: `Optional[String[1]]`
839+
840+
The jvmRoute to use for load balancing
841+
842+
Default value: `undef`
843+
835844
##### <a name="-jira--tomcat_max_http_header_size"></a>`tomcat_max_http_header_size`
836845

837846
Data type: `Integer`

manifests/init.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@
180180
# Tomcat bind port
181181
# @param tomcat_shutdown_port
182182
# Tomcat shutdown command port
183+
# @param jvm_route
184+
# The jvmRoute to use for load balancing
183185
# @param tomcat_max_http_header_size
184186
# Tomcat connector setting
185187
# @param tomcat_min_spare_threads
@@ -387,6 +389,7 @@
387389
Optional[String] $tomcat_address = undef,
388390
Stdlib::Port $tomcat_port = 8080,
389391
Stdlib::Port $tomcat_shutdown_port = 8005,
392+
Optional[String[1]] $jvm_route = undef,
390393
Integer $tomcat_max_http_header_size = 8192,
391394
Integer[0] $tomcat_min_spare_threads = 25,
392395
Integer[0] $tomcat_connection_timeout = 20000,

spec/classes/jira_config_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ def self.clear_cache
112112
end
113113
end
114114

115+
context 'with jvm_route' do
116+
let(:params) do
117+
{
118+
javahome: '/opt/java',
119+
version: DEFAULT_VERSION,
120+
jvm_route: 'node1',
121+
}
122+
end
123+
124+
it { is_expected.to compile.with_all_deps }
125+
126+
it 'configures jvmRoute in server.xml' do
127+
is_expected.to contain_file(FILENAME_SERVER_XML).
128+
with_content(%r{<Engine name="Catalina" defaultHost="localhost" jvmRoute="node1">})
129+
end
130+
end
131+
115132
context 'with custom session_timeout' do
116133
let(:params) do
117134
{

templates/server.xml.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<% } -%>
109109
/>
110110
<% } -%>
111-
<Engine name="Catalina" defaultHost="localhost">
111+
<Engine name="Catalina" defaultHost="localhost"<% if $jira::jvm_route { %> jvmRoute="<%= $jira::jvm_route %>"<% } %>>
112112
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
113113

114114
<Context path="<%= $jira::contextpath %>" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

0 commit comments

Comments
 (0)