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


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

Thanks Daniel,

wil this serve the purpose ? i understand what you are trying to say , but i am not sure the mix/match like this will work or not.

bash "install_bill" do
     cwd "#{node[:mule][:bin_dir]}"
     code <<-EOH
       ./deploy.sh -v x-billing-1.1.0-SNAPSHOT -e $env ebpi x-billing
       sleep 30
        echo " i am done deploying the app"
     EOH
     returns 0
    not_if { ::File.exists?(extract_path) }
      action :nothing
 end




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

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

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.
It does, but I think what you want is for the bash script to run anytime some condition is not met (looks like this condition is, "my application is correctly deployed to the latest version"). If it fails for some reason, and you want Chef to retry it next time, then you probably want to use the default action on the script resource, and let the not_if/only_if check take care of deciding whether it should run.
 


Thanks
Manoj



-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§