[chef] Re: Re: Catch Execute exit codes.


Chronological Thread 
  • From: Damien Roche < >
  • To:
  • Subject: [chef] Re: Re: Catch Execute exit codes.
  • Date: Sun, 27 Sep 2015 22:47:03 +0100

I would recomend the ark cookbook instead.

On 27 Sep 2015 22:35, "Yoshi Spendiff" < "> > wrote:
An execute resource will fail the chef rub unless a return code from the returns attribute to the resource is returned from the command or ignore failure is set on the resource, so there's no handling of specific return codes I'm aware of, just success/fail.

If it's just a matter of trying again you could use the retries and retry_delay attributes to the execute resource.

For more sophisticated error handling you're probably going to want to use a ruby_block or a script resource instead of an execute and write in error handling in the ruby code or script

> On Sep 27, 2015, at 2:11 PM, Douglas Garstang < "> > wrote:
>
> I'm using an execute resource to unzip a file. When that fails, the exit code is 9. Is there a way to catch specific exit codes from execute resources and take some custom action?
>
> Thanks,
> Doug
>



Archive powered by MHonArc 2.6.16.

§