The way I’m doing it right now (based on Edmund’s Tomcat LWRP and additions to application to support paths and such), is anything that can be easily deployed - ie just the war file, or just the installation of tomcat, is done using the stock stuff.
However I have an app that relies on some support files, and that is put into it’s own recipe. I have found, unfortunately, that I cannot rely on the automagic install of tomcat from the application cookbook.
In an ideal world:
Application is single war file
Application uses a DB
Chef is aware of DB
All you need in the run list is
But, in my case, it’s now:
recipe[myapp::asv], #Determines an node-specific value that is needed for the configuration template, and stores it as a node attribute…
So this ensures tomcat’s there, so I can dump the necessary files in the tomcat directories with the myapp recipe, and then the war file is handled by the application cookbook.
Not as simple, but not that hard, either.
I think chef is absolutely worth the effort to get working right, and it’ll pay off many dividends in the end…
From: Haselwanter Edmund [mailto:email@example.com]
Sent: Wednesday, June 29, 2011 10:23 AM
Subject: [chef] Re: Application cookbook
On 29.06.2011, at 15:46, Tim Diggins wrote:
Can anyone answer why the application cookbook is grouped together? It seems like it would make more sense to have a rails cookbook, a java-container (or tomcat) cookbook, a django cookbook.
I think that depends were you want to do the “data driven” part. at the moment the application coobook loops through all databag application definitions and runs the recipes for that.
Is there no way of separating out the commonalities between them other than having them all in the same cookbook?
recently I did some rework on that. have a look at:
were I moved the recipes to definitions.
then you can do something like:
app = JSON.parse(File.open(File.join(File.dirname(FILE),"…/databags/jolokia.json")).read)
node.run_state[:current_app] = app
application_java_webapp “jolokia-java_webapp” do
in ay other recipe
But this is still a very good question. Were to put all the supporting stuff?
If I have a reverse proxy for tomcat, should it go in the application cookbook, the apache cookbook, or the tomcat cookbook … ?
DI Edmund Haselwanter, firstname.lastname@example.org:email@example.com, http://edmund.haselwanter.com/
http://www.iteh.at | http://facebook.com/iTeh.solutions | http://at.linkedin.com/in/haselwanteredmund