0
votes

PuppetLabs have a module on PuppetForge for deploying Tomcat and its configuration. https://forge.puppet.com/puppetlabs/tomcat

Tomcat has a documented feature which prevents you from setting the context path in the file META-INF/context.xml

Instead of setting the context path from the path property in context.xml Tomcat uses the filename of the .war file to determine the path. Other Tomcat options are described in stackoverflow here: How can I specify "Context path" on Tomcat 8 inside META-INF/context.xml in java war file?

In my view putting a version number into the name of the warfile is a good thing, this Tomcat feature is a bad thing.

I'm hoping that PuppetLabs' Tomcat module has a property that allows you to set the context path and work around Tomcat's nastiness.

Does anybody know how to do this ?

2

2 Answers

0
votes

An answer can be found at: https://tickets.puppetlabs.com/browse/MODULES-1545

There's an example there which shows where to supply the actual war file name including the version number, where to provide it without the version number. This latter parameter determines the name used for a copy of the war file, it's this copy which sets the context root.

IMPORTANT The Puppetlabs Tomcat module (version 1.6.1) has a bug which prevents it from recognising an updated war file. A guy called Daniel Haag supplied a fix for this bug in November 2015. It only works if you apply Daniels patch.

Why Daniel's patch has not made it into the current version I do not understand. I'm unable to use it without Daniel's fix.

0
votes

If you are restricted to using a version of puppetlabs-tomcat module WITHOUT applying the bug fix for deployment of war files.

Go ahead and use it to configure Tomcat but avoid its war functionality. Do your own thing to ensure you have the correct version of .war file in the webapps directory and named to ensure the desired context root.