[chef] Re: run chef_recipe inside the chef resources


Chronological Thread 
  • From: Xabier de Zuazo < >
  • To:
  • Subject: [chef] Re: run chef_recipe inside the chef resources
  • Date: Fri, 3 Oct 2014 16:09:09 +0200

On Thu, Sep 18, 2014 at 05:50:53AM -0700, 

 wrote:
> I need to run chef_recipe inside the chef resources like 
> 
> ruby_block "XXXXXXX" do
> block do
>       if $inc == 1 then 
>           puts "call rollback method!"
>           include_recipe "rollback::stopservices"
>           else 
>           puts "No need to call rollback method!"
>       end
> end
> 
> but its shows error, I need to know it is possible to call chef recipe from 
> any
> chef resources in one recipe? 
> and how can I call one chef resources from  another chef resource? same or 
> diff
> resources???

Perhaps in your case you should notify some stops:

http://docs.getchef.com/chef/resources.html#notifications

I also extracted this code from the zookeeper_bridge cookbook with a
recipe_block implementation example:

https://gist.github.com/zuazo/623d1cfcdc2ab2e00356

It is very hackish. But maybe it can help you.

Attachment: signature.asc
Description: Digital signature




Archive powered by MHonArc 2.6.16.

§