Skip to content

Commit

Permalink
Merge pull request voxpupuli#98 from jacobmw/master
Browse files Browse the repository at this point in the history
Paramaterizing more tomcat settings
  • Loading branch information
igalic committed Oct 14, 2015
2 parents 59ee27e + 6f18c36 commit 8ddca94
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 19 deletions.
23 changes: 15 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,21 @@
$stop_jira = 'service jira stop && sleep 15',

# Tomcat
$tomcatAddress = undef,
$tomcatPort = 8080,
$tomcatNativeSsl = false,
$tomcatHttpsPort = 8443,
$tomcatKeyAlias = 'jira',
$tomcatKeystoreFile = '/home/jira/jira.jks',
$tomcatKeystorePass = 'changeit',
$tomcatKeystoreType = 'JKS',
$tomcatAddress = undef,
$tomcatPort = 8080,
$tomcatMaxHttpHeaderSize = '8192',
$tomcatMinSpareThreads = '25',
$tomcatConnectionTimeout = '20000',
$tomcatEnableLookups = false,
$tomcatNativeSsl = false,
$tomcatHttpsPort = 8443,
$tomcatProtocol = 'HTTP/1.1',
$tomcatUseBodyEncodingForURI = true,
$tomcatDisableUploadTimeout = true,
$tomcatKeyAlias = 'jira',
$tomcatKeystoreFile = '/home/jira/jira.jks',
$tomcatKeystorePass = 'changeit',
$tomcatKeystoreType = 'JKS',

# Tomcat Tunables
$tomcatMaxThreads = '150',
Expand Down
80 changes: 80 additions & 0 deletions spec/classes/jira_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,86 @@
.with_content(/acceptCount="200"/) }
end

context 'tomcat MaxHttpHeaderSize' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatMaxHttpHeaderSize => '4096',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/maxHttpHeaderSize="4096"/) }
end

context 'tomcat MinSpareThreads' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatMinSpareThreads => '50',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/minSpareThreads="50"/) }
end

context 'tomcat ConnectionTimeout' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatConnectionTimeout => '25000',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/connectionTimeout="25000"/) }
end

context 'tomcat EnableLookups' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatEnableLookups => 'true',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/enableLookups="true"/) }
end

context 'tomcat Protocol' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatProtocol => 'HTTP/1.1',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/protocol="HTTP\/1.1"/) }
end

context 'tomcat UseBodyEncodingForURI' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatUseBodyEncodingForURI => 'false',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/useBodyEncodingForURI="false"/) }
end

context 'tomcat DisableUploadTimeout' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatDisableUploadTimeout => 'false',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/disableUploadTimeout="false"/) }
end

context 'tomcat EnableLookups' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:tomcatEnableLookups => 'true',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/enableLookups="true"/) }
end

context 'tomcat maxThreads' do
let(:params) {{
:version => '6.3.4a',
Expand Down
22 changes: 11 additions & 11 deletions templates/server.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
address="<%= @tomcatAddress %>"
<%- end -%>
maxThreads="<%= @tomcatMaxThreads %>"
minSpareThreads="25"
connectionTimeout="20000"
enableLookups="false"
maxHttpHeaderSize="8192"
protocol="HTTP/1.1"
useBodyEncodingForURI="true"
minSpareThreads="<%= @tomcatMinSpareThreads %>"
connectionTimeout="<%= @tomcatConnectionTimeout %>"
enableLookups="<%= @tomcatEnableLookups %>"
maxHttpHeaderSize="<%= @tomcatMaxHttpHeaderSize %>"
protocol="<%= @tomcatProtocol %>"
useBodyEncodingForURI="<%= @tomcatUseBodyEncodingForURI %>"
acceptCount="<%= @tomcatAcceptCount %>"
disableUploadTimeout="true"
disableUploadTimeout="<%= @tomcatDisableUploadTimeout %>"
<% if @tomcatNativeSsl -%>
redirectPort="<%= @tomcatHttpsPort %>"
<% end -%>
Expand All @@ -65,12 +65,12 @@
<%- if @tomcatAddress -%>
address="<%= @tomcatAddress %>"
<%- end -%>
maxHttpHeaderSize="8192"
maxHttpHeaderSize="<%= @tomcatMaxHttpHeaderSize %>"
SSLEnabled="true"
maxThreads="<%= @tomcatMaxThreads %>"
minSpareThreads="25"
enableLookups="false"
disableUploadTimeout="true"
minSpareThreads="<%= @tomcatMinSpareThreads %>"
enableLookups="<%= @tomcatEnableLookups %>"
disableUploadTimeout="<%= @tomcatDisableUploadTimeout %>"
acceptCount="<%= @tomcatAcceptCount %>"
<% if ! @proxy['scheme'] -%>
scheme="https"
Expand Down

0 comments on commit 8ddca94

Please sign in to comment.