[chef] Re: Re: A case for 'run once' recipes


Chronological Thread 
  • From: Ezra Zygmuntowicz < >
  • To:
  • Subject: [chef] Re: Re: A case for 'run once' recipes
  • Date: Wed, 23 Sep 2009 11:40:23 -0700


On Sep 23, 2009, at 8:10 AM, Caleb Tennis wrote:


Spawning new clouds repaidly with chef is only one of its possible use cases, maintaining them is another. Chef would gain a lot of traction and support in the greater ISP arena if these 'run once' features are implemented.

Are you looking for something more complicated than adding a not_if into your current recipe sets? I have a lot of "run once" recipes in this fashion.

Or, you can just put a big if() around the recipe blocks. The whole thing is just interpreted ruby.

Caleb

I agree with Caleb, the whole point of chef is to make your recipes idempotent. For the run once recipes that I have needed you can have the resource touch a file called .alreadydone or something and add a not_if { File.exists?('.alreadydone')} to the resource to emulate run once recipes. Perhaps you could wrap up this functionality into the resources themselves with a little work to have certain resources do this automatcially for you?

Cheers-

Ezra Zygmuntowicz







Archive powered by MHonArc 2.6.16.

§