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.
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 ©. 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 ©. 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).
Thanks in advance for any constructive advice.