Skip to content

Commit

Permalink
Merge pull request #47 from poikilotherm/master
Browse files Browse the repository at this point in the history
Add <Context> path attribute as a parameter for jira class
  • Loading branch information
mkrakowitzer committed Jan 20, 2015
2 parents b3f2519 + ea5df91 commit eab2ce7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ If the jira service is managed outside of puppet the stop_jira paramater can be

Defaults to {}, See examples on how to use.

#####`$contextpath = ""`

Defaults to an empty string (""). Will add a path to the Tomcat Server Context.

####Tomcat parameters####

#####`$tomcatPort`
Expand Down Expand Up @@ -363,6 +367,7 @@ jira::proxy:
scheme: 'https'
proxyName: 'jira.example.co.za'
proxyPort: '443'
jira::contextpath: '/jira'
```

Reverse proxy can be configured as a hash as part of the JIRA resource
Expand Down
2 changes: 2 additions & 0 deletions jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ jira::proxy:
scheme: 'https'
proxyName: 'www.exmaple.co.za'
proxyPort: '443'
# Configure path attribute for the <Context>
jira::contextpath: '/jira'
9 changes: 6 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,15 @@

# Reverse https proxy
$proxy = {},
# Context path (usualy used in combination with a reverse proxy)
$contextpath = '',

) inherits jira::params {

if $jira::db != 'postgresql' and $jira::db != 'mysql' {
fail('jira db parameter must be postgresql or mysql')
}
# Parameter validations
validate_re($db, ['^postgresql','^mysql'], 'The JIRA $db parameter must be "postgresql" or "mysql".')
validate_hash($proxy)
validate_re($contextpath, ['^$', '^/.*'])

if $::jira_version {
# If the running version of JIRA is less than the expected version of JIRA
Expand Down
9 changes: 9 additions & 0 deletions spec/classes/jira_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@
it { should contain_file('/home/jira/dbconfig.xml')
.with_content(/<url>my custom dburl<\/url>/) }
end
context 'tomcat context path' do
let(:params) {{
:version => '6.3.4a',
:javahome => '/opt/java',
:contextpath => '/jira',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')
.with_content(/<Context path=\"\/jira\" docBase=\"\${catalina.home}\/atlassian-jira\" reloadable=\"false\" useHttpOnly=\"true\">/) }
end

end
end
2 changes: 1 addition & 1 deletion templates/server.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">

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


<!--
Expand Down

0 comments on commit eab2ce7

Please sign in to comment.