[chef] Re: I am not loading because I have already seen it.


Chronological Thread 
  • From: Joshua Timberman < >
  • To: Chef users < >
  • Subject: [chef] Re: I am not loading <cookbook::recipe> because I have already seen it.
  • Date: Sun, 17 Aug 2014 22:49:14 -0600

This is exactly the kind of thing I'd use a definition to do. In a post I wrote earlier this year about cookbook development, I discuss the use of a definition in our 'chef-splunk' cookbook.

http://www.getchef.com/blog/2014/02/03/evolution-of-cookbook-development/

Documentation about definitions here:

http://docs.getchef.com/essentials_cookbook_definitions.html

Hope this helps,
Joshua


On Wed, Aug 6, 2014 at 2:23 PM, Jason Newblanc < " target="_blank"> > wrote:

Hi folks,

I am a relatively new Chef user running chef solo on linux.  I'm running into a
problem when trying to invoke a community cookbook/recipe multiple times with
different databags.  I'm hoping to find some advice/help.

Some details:

I have a "common" role definition and its runlist contains a wrapper recipe (a)
which loads some data from a databag (b) and uses "include_recipe" to
load/invoke a 3rd party cookbook/recipe (c).  This all works as expected.  I
also have a role specific role definition with a runlist that contains a
different wrapper recipe (d) which, similarly, loads some data from a DIFFERENT
databag (e) and uses "include_recipe" to load/invoke the SAME 3rd party
cookbook/recipe (c).  What I'm finding is that the third party recipe doesn't
get invoked by "include_recipe" the second time.

When I run in debug mode, I see that my combined runlist is accurate, but later
down the log, I see the message, "I am not loading <cookbook::recipe> because I
have already seen it."

I realize that chef converges such that recipes don't get loaded twice, but I'm
not sure how to reconcile that convergence with the results that I'm after.  Is
there a way to invoke the loaded recipe a second time (with different data)?
Is my model/understanding flawed?  Am I doing it wrong?

I did come across this old bug which describes a similar problem, but the
workaround doesn't seem to work anymore and the proper solution isn't very
clear (to a newbie).

https://tickets.opscode.com/browse/CHEF-1406

Thanks in advance for any constructive advice.






Archive powered by MHonArc 2.6.16.

§