Choosing at run time which cookbooks and recipes to use?


#1

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?


#2

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