[chef] Re: stopping recipe execution early


Chronological Thread 
  • From: Peter Donald < >
  • To: " " < >
  • Subject: [chef] Re: stopping recipe execution early
  • Date: Wed, 17 Oct 2012 21:23:22 +1100

Hi,

We occasionally need to do this to coordinate converges across multiple nodes. The way we have typically done this is by defining a cookbook that has a recipe that simply includes all the other recipes and then we put guards on them like

include_recipe "linux-base"
include_recipe "server-setup" unless node['switch']

unless node['switch2']
  include_recipe "app-deploy"
  include_recipe "monitor-up"
end

Not sure if that helps...

On Wednesday, October 17, 2012, Pitucha, Stanislaw Izaak wrote:
Hi all,
Is there some official (or at least working) way to stop execution of a
recipe early? (without affecting the rest of the run list)
For example if I have the whole recipe depending on a single switch, I could
just put it inside of:

if node[:switch]
  ....
end

but that would be spanning a couple of screens of code - not the cleanest
solution. Is there a good way to stop execution without throwing an
exception, so that I can do:

some_stop_function unless node[:switch]

Regards,
Stanisław Pitucha
Cloud Services
Hewlett Packard




--
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§