I can't (easily) change the "base" cookbook, because the base cookbook is "application"this sounds like the same as the OP's issue.if i run the LWRP more than one time, the include_recipe gets ignored.I am using the "application" and "application_java" cookbooks, which include_recipe "tomcat" in the LWRP, and i've brought the same code over to an new cookbook for tomeeplus.include_recipe is working fine if I only run the LWRP precisely one time.
On Thu, May 30, 2013 at 8:22 AM, Dorian Jaminais < " target="_blank"> > wrote:
Thank you all for your responses.
@peter : run_context.include_recipe works but only if the LWRP is called once in during the chef_run.
I have included a recipe that installs all the dependencies for the LWRP to work.This works perfectly, even if still I don't understand why I had this strange behavior with run_context.include_recipe2013/5/30 Peter Donald < " target="_blank"> >
Hi,
I think it is more useful to see it as a failure of chef rather than a
On Thu, May 30, 2013 at 8:43 AM, Daniel DeLeo < " target="_blank"> > wrote:
> Bringing this back to the OP's issue, I think including a recipe (the normal
> way) to install prerequisites of a LWRP is the right way to go about it. If
> you are doing wizardry with chef internals, either 1) you're making
> something more complicated than it should be, 2) chef is making something
> more complicated than it should be, or 3) you're a wizard. So far, I'm
> inclined to think that including recipes from a provider falls into category
> #1, since you can just as easily and elegantly solve the problem with a role
> (or role cookbook if that's your thing). Am I missing something?
failure of the user. i.e. Option 2.
In my mind LWRPs are a mechanism for creating composable
abstractions. Anything you can do in a recipe should be possible to do
in a LWRP. Where this is not true I would consider it a bug.
For this specific scenario I can easily see a use for it. In our
environment, many of our recipes are data driven. Data is collected
from search + rules + external systems (ldap/db etc) and then this is
interpreted and resources defined based on the data. So often we will
not know which LWRPs will be active (and thus which precursor recipes
should be included) until the data is interpreted.
That said I thought include_recipe worked from within LWRPs...
--
Cheers,
Peter Donald
--
Archive powered by MHonArc 2.6.16.