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


Chronological Thread 
  • From: Kenneth Kalmer < >
  • To:
  • Subject: [chef] Re: Re: Re: A case for 'run once' recipes
  • Date: Wed, 23 Sep 2009 21:33:12 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=KLl3s5b9Zlk3AlwO4fF5ruxrFg8E6z+AHD5zEfSJIgyQLcGxMOlr3kYvT7D1NrySbi psakhNWA2oWALfkwlEOY0XwI6IZ7L+3gAyT49+Rhk6kuyh0R0s+Q+r8JtBv+r0GfBgfA HwXt5kF0cLVyAGn8HYYjFzd45U0b3L+MgeGmA=

On Wed, Sep 23, 2009 at 8:40 PM, Ezra Zygmuntowicz < "> > wrote:

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?

Well, I should have spent more time in the original message, including actually linking to the footnotes :(

To be more verbose, we'll commission a new server with chef and once commissioned we'll need to be able to run the same recipes once off with different attributes each time. For instance, we'll have a recipe that adds a user with their quotas, another for setting up the virtual host, stats, etc, and another for setting up their database. For each hosting account created I want to be able to run the same recipe, loading the individual recipes, but a custom set of attributes for that run.

I could perfectly well do this with chef-solo and use a JSON file, but then I still have my agents on the nodes that need to run chef-solo, where they do it themselves currently.

Arjuna made an example in the wiki, http://wiki.opscode.com/display/chef/Libraries, for an ISP scenario, that I still have to test. With my limited knowledge of chef at this stage it seems that it would rebuild everything on every run for every user. I will probably stand corrected here.

Apologies if I'm being a pain in the behind on this one, but on the surface this seems like such a great fit.

Best
 
--
Kenneth Kalmer
">
http://opensourcery.co.za
@kennethkalmer



Archive powered by MHonArc 2.6.16.

§