[chef] Re: Re: Application cookbook


Chronological Thread 
  • From: Tim Diggins < >
  • To:
  • Subject: [chef] Re: Re: Application cookbook
  • Date: Wed, 29 Jun 2011 15:41:02 +0100

edi -

My main query is about whether one should have an "application" cookbook at all, rather than having a "django", "rails", "tomcat" cookbook, and then creating a specific cookbook/recipe for one's own application itself (e.g. my-django-app), which co-ordinates the other cookbook recipes (say python, django-specifics, nginx&gevent coordination, etc) 


also - (slightly off topic) but instead of your vagrant/solo-specific version:
app = JSON.parse(File.open(File.join(File.dirname(__FILE__),"../databags/jolokia.json")).read)
you might want to instead consider monkey-patching the data_bag, data_bag_item and search methods (I had a stab at this before... see gist and fuller config/background at http://red56.wordpress.com/2011/03/13/chef-and-vagrant-workflow/ trying to make recipes sharable across vagrant + chef-solo, and chef-server/platform)

T


On Wed, Jun 29, 2011 at 3:23 PM, Haselwanter Edmund < "> > wrote:
Hi,

On 29.06.2011, at 15:46, Tim Diggins wrote:

Ohai chefs!

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
  context_cookbook "zabbix"
end

application_tomcat "jolokia-tomcat"

node.run_state.delete(:current_app)

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 ... ?

cu edi





--
------------------------------------------------------

Tim Diggins
http://red56.co.uk
" target="_blank">

07515 931 642 / +447515931642




Archive powered by MHonArc 2.6.16.

§