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


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

thanks Greg for your answer, can a LWRP do the same as recipe ? I need to download the java-wrapper zip file only once, and then copy it for each of the cookbook that would need it. Where is the 'normal' place to put it so I can check if it is there and don't re-fetch ?


On Wed, Oct 23, 2013 at 4:21 PM, Greg Symons < " target="_blank"> > wrote:
You can expose the work that the java_wrapper recipe does as an LWRP: http://docs.opscode.com/lwrp_custom.html. Another option might be using the application_java cookbook, assuming it does things the way you need it.

Greg


On 10/23/13 07:48, Alexandre Russel wrote:
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.

§