Right, you can do that, but its fussy. And like I said that is just a symptom. The worse problems come later when you don't know where those LWRPs are going to be in the run_list, and you only want to trigger the resource that writes out the file once, so you use a delayed notification -- but now nothing in your run_list can depend on that file getting updated first. It works much better to collect all the information at compile-time, and then execute the resource for the file the first time the definition is encountered in the run_list. That way every recipe that comes after the first time the definition is encountered will see the file updated, and you don't have to manually worry about ordering. If you try to do it with an LWRP then you wind up pondering hacks to make it run at compile-time like chef_gem or other issues like that, and like dan wrote you wind up wanting to include_recipe from within an LWRP to avoid users having to manually insert a special resource in their run_list at the correct spot. If you use a definition everything just works the way you want it to (because you really want compile-time reusable code rather than convergence-time reusable code). On 10/5/13 12:17 AM, Ranjib Dey wrote: " type="cite"> |
Archive powered by MHonArc 2.6.16.