In Ruby code it’s common to nest directories. E.g.
require 'chef/mixin/params_validate’
You can’t do the same with cookbooks, they have a fixed structure. My argument has nothing to do with resource convergence.
Thanks for your comment!
From: Tensibai
Reply-To: " "> " Date: Thursday, September 17, 2015 at 1:11 AM To: " "> " Subject: [chef] Re: Re: Re: Object-Oriented Chef
Usually when I ear that, I've the reaction "You're doing it wrong". If you need arbitrary nesting of cookbooks, than you're not anymore describing a state but the steps to get to this state. If you use Chef to replace scripts and run it only on-demand I see why you're looking for this, but IMHO you're using the wrong tool in this case as Chef is aimed to be run periodically to enforce a state, so you should avoid nested steps. There's some case where a "dual run" is needed as you can't do the whole state in one pass, in this case my usual way is to set a tag on node on the first pass, skip what has to be skipped on the first pass when the tag is absent, and use a execute resource to schedule the next run in 1 min or more, depending on the use case. I do this to provision mysql clusters, I can't tell who the replication partner will be before it's up, so I schedule a new chef run every 2 mins until the partner is found in search and the initial replication is done. This leave unused code in the long term run for those boxes, but it's better than looping within the run waiting the other box to get in (which may never be true if your vagrant driver provision sequentially as the vSphere plugin did before 1.0.2 for example) This was my $.2 on the subject :) |
Archive powered by MHonArc 2.6.16.