[chef] including multiple time the same recipe with different attribute


Chronological Thread 
  • From: Alexandre Russel < >
  • To:
  • Subject: [chef] including multiple time the same recipe with different attribute
  • Date: Wed, 23 Oct 2013 14:48:12 +0200

Hi,

 I'm trying to deploy multiple java applications with the java wrapper cookbook. What the java wrapper does is:
- download the java wrapper, unpack it
- copy files to a specified directory
 - create a service and start it.
what it needs is:
- the name of the the service and the place where to find the jars.


The java-wrapper works for a single application (I've shared the cookbook on the site).
What I was planning to do was, for each application do something like:
- recipe A:
  override[java-wrapper][name] = a
  include_recipe "java_wrapper"
- recipe B:
  override[java-wrapper][name] = b
  include_recipe "java_wrapper"

hoping that the java_wrapper  recipe would be called once with a attribute and once again with b attribute. But what is happening is that the "java_wrapper" recipe is run only once. After re-reading chef documentation, I'm not even sure the attribute java-wrapper/name can have value a and then b during a chef-client run.

What would be a good way to solve the original problem ?

Alex



Archive powered by MHonArc 2.6.16.

§