On Mar 19, 2012, at 4:04 PM, Hui Hu wrote:If you write your recipes correctly, when A,B, & C run for the second time, they will be able to determine that nothing needs to change, and therefore they won't restart any services. This is what it means to be "idempotent". The Opscode folks are responsible for making their code idempotent inside of chef-client, and it's up to *YOU* to make sure that your recipes are also idempotent.
> 1) Running recipes Incrementally
> Assume a node has a run_list : [A,B,C] , now I want to add a new recipe D into its run_list, then run chef-client. So chef-client will re-run A,B,C,D. However, re-run A,B,C is unneccessary, and sometimes I don't want A,B,C to be re-ran which will cause service provided in A,B,C to be restart.
Otherwise, you made the bed of thorns, and now you get to lay in it.
Again, that's up to you. You write your cookbooks and recipes in such a way that they can appropriately de-install themselves, and that will happen.
> 2) Cleanup after Recipe removal
> This problem is described here : http://help.opscode.com/discussions/questions/271-cleanup-after-recipe-removal .
>
> It says when a recipe is removed from the old run_list, can chef-client detects the change, and remove the packages/files/init.d services installed by that recipe ? Maybe adding a rollback() method in every recipe to do this kind of removal and let chef-client call rollback() automactically ?
Otherwise, well, you get out of the system what you put into it.
--
Brad Knowles < "> >
SAGE Level IV, Chef Level 0.0.1
Archive powered by MHonArc 2.6.16.