[chef] Re: How to tell if Chef is running?


Chronological Thread 
  • From: Andrew Shafer < >
  • To:
  • Subject: [chef] Re: How to tell if Chef is running?
  • Date: Mon, 24 Jan 2011 00:09:59 -0700


You could potentially model the 'un' of every resource in an inverse cookbook, but there are usually enough complicated corner cases that the prevailing wisdom, when possible, is to build systems in such a way that each node can be blow away and rebuilt.

Your mileage may vary.


On Sun, Jan 23, 2011 at 10:54 PM, Noah Gibbs < "> > wrote:
Is there a standard way to tell if your (ruby) code is being invoked (indirectly) by a Chef run?  In this specific case the code is executing in a RubyGems pre-install hook.

Semi-relatedly, Chef seems strongly aimed at being run to configure the machine, and then mostly not run again on the same node except to add more software.  For example, there aren't a lot of uninstall-based resources, I don't see an obvious way to "reverse" a cookbook, few cookbooks seem written to work incrementally or in stages, etc.  Is that pretty much how it's intended, or am I missing something?

To be fair, I haven't come up with a good scenario yet for why you'd want to run it on a more continuous basis (at least, not one where you couldn't do it better in some other way).  But it's odd because a lot of the individual resources seem to be kind of incremental in feel (specify how many backups to make, specify that you're syncing the git repository rather than just creating it, etc) -- almost as though they're meant for repeated use as a deployment tool, for instance.  But the cookbooks don't seem to be written the same way.  It's slightly confusing.








Archive powered by MHonArc 2.6.16.

§