[chef] Re: Re: 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: Re: Re: chef recipe does not fail on bash resource
  • Date: Mon, 30 Sep 2013 16:07:59 -0700

Thanks Daniel,

I think i got the point, i wil basically end up removing the notify section and add an if condition for that also,

Anyways id there a way to do a a force rerun of a recipe , i mean like cookbook_file should be rerun if i pass a flag or something, i think that's easier than writing an if condition for this use case.


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

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

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
This is the basic idea. If you intend to upgrade the x-billing-1.1.0-SNAPSHOT package and you need to re-run deploy.sh whenever that happens, you'll need to find a condition for not_if that will properly account for that. Also, you no longer should need `action :nothing`, as this bash resource will skip itself whenever "extract_path" exists.


-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§