- From: Joe Nuspl <
>
- To:
- Subject: [chef] Re: Announcing zap-0.0.1
- Date: Tue, 26 Nov 2013 15:25:44 -0800
Original I had implemented this as report handler but doing these actions in a report handler smelled funny (or tasted bad).
I've improved the LWRP by splitting it into two phases (implemented as two actions). :delay is the default action. When it runs, it clones the resource, sets the action to :run, and appends it to the end of the resource collection.
I'm working on making the LWRP more generic and being able to override the collect the existing, collect the resource, and eliminate cruft stages with your own routines. All in good time.
For the time being, v0.0.4 has been released.
Joe
On Nov 24, 2013, at 9:31 PM, Ranjib Dey <
">
> wrote: hi Joe
thanks for sharing the cookbook. we have the exactly same issue (nginx conf.d , iptables rules and several others), and I am in process of opensourcing our conf.d style (authoritative) implementation.
a major challenge we faced with modeling the delete un-managed files was how to detect them. In your implementation you are doing by iterating the resource collection. I am not sure if you can get a fully expanded resource collection from any resource. Because chef allows dynamic resource addition, at best you can get only the resource list that was statically added (across all chef recipes) and dynamically added till the point of detection (in your case till the zap_directory resource declaration), notification brings another twist in this whole dynamic expansion. In simpler terms what it means is, if i use an lwrp ( that expands into a set of files inside the zap directory) after the zap_directory resource declaration, will they be deleted in next run? because zap_directory provider cant see them in resource collection.
In our implementation we use a report handler to do the deletion. the logic is ditto (via iterating resource collection). I find it bit controversial (i dont want any report handler to change my system's state or do destructive operations), but this implementation does a bug free & clean job. and provides some basic stuff on top of which we can improve.
I'm very happy to see your implementation :-) . thanks again for sharing this.
regards ranjib
|
Archive powered by MHonArc 2.6.16.