Skip to content

Commit

Permalink
Add <Context> path attribute in server.xml.erb.
Browse files Browse the repository at this point in the history
This adds the template parameter and the necessary parameter to init.pp. It adds validations for $contextpath, $proxy and $db, too.
  • Loading branch information
poikilotherm committed Jan 19, 2015
1 parent b3f2519 commit b0fcde9
Show file tree
Hide file tree
Showing 4 changed files with 14 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
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 b0fcde9

Please sign in to comment.