Search code examples
javatomcattomcat7chef-infraubuntu-server

How to upload a WAR file on Tomcat 7 cookbook by Chef?


I'm trying deploy a War file on my Tomcat 7 installed by a cookbook on CHEF. But, I can't find a single answer for my question at any forums. I don't have any idea how to do this! I'm using a Ubuntu server 12.10. The recipe that I'm using is https://github.com/solarvm/tomcat7-cookbook


Solution

  • The simple way to do is is to use the service resource to stop Tomcat, use the bash resource or a file resource to copy the WAR file, and then use the service resource to start Tomcat again.

    That cookbook you are trying to use doesn't do WAR file deployment. But I found this one - https://github.com/poise/application_java - that may do the job.

    And for what it is worth, I think you could find a better Tomcat installation cookbook too. For a start, there is a "tomcat" recipe on the Opscode Community Cookbooks site that can handle Tomcat 7.

    (Hint: don't just use the first cookbook you find with Google. Do a Github search, and try to assess the cookbooks functionality and quality)