[chef] Re: Re: Re: Re: chef recipe does not fail on bash resource


Chronological Thread 
  • From: Manoj Thakkar < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Re: chef recipe does not fail on bash resource
  • Date: Mon, 30 Sep 2013 14:46:46 -0700

Thanks Daniel,

will the not_if work with action:nothing ?  if not then it will be a little trickier ,  i think i might have to break the dependency on cookbook file for bash script and depend on some other file or resource.


Thanks
Manoj


On Mon, Sep 30, 2013 at 2:41 PM, Daniel DeLeo < " target="_blank"> > wrote:

On Monday, September 30, 2013 at 2:35 PM, Manoj Thakkar wrote:

Thanks Andy,

It helped, The tricky part is if the bash script fails the cookbook file attribute will not run in next time since the file is the same so the bash resource will not run also.

How do i make bash script run if it failed last time ? is there a feature ? or may be i shall throw a file output check the status is that file and rerun bash script no matter what.
Your best bet is to use some knowledge about what the script actually does to guard against it running when not needed, and code this into a `not_if`, `only_if` or `creates` parameter on the bash resource itself. See: http://docs.opscode.com/resource_common.html
 

Thanks
Manoj



-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§