[chef] Re: Choosing at run time which cookbooks and recipes to use?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Choosing at run time which cookbooks and recipes to use?
  • Date: Tue, 25 Oct 2011 09:13:00 -0700

On Tuesday, October 25, 2011 at 7:47 AM, Maven User wrote:
> Is there a way that when a chef-client run starts, you can tell it to only 
> run a subset of the configured recipes?
> 
> For instance, we have several of our deployable units deployed to a 
> particular server. Only one of them has changed and in order to save time, 
> I'd like to only run that particular one (some of the "do I have this 
> installed" testing is kinda slow).
> 
> Is there any easy way to do that?
There's not any support for something like this built in to Chef, but you can 
wrap your recipes (and include_recipe statements even) in conditionals and 
control their execution with attributes.

    if node[:should_do_something]
      include_recipe "some_cookbook"
      # install packages, etc.
    end



-- 
Dan DeLeo




Archive powered by MHonArc 2.6.16.

§