How to ignore some exception in a cookbook


#1

In one of my receipt I need to install a gem

gem hipchat do
action: install
end

However from time to time it fails due to network or other issue.

I do not want it to fail the overall installation process. I would rather
have the whole provision completed and then go in later and fix it manually
myself.

Is there any way I can prevent its failure from stopping the convergence?

Cheers


#2

On 2015-02-27 06:35, Anthony Kong wrote:

In one of my receipt I need to install a gem

gem hipchat do
action: install
end

[…]
Is there any way I can prevent its failure from stopping the convergence?

Try with ignore_failure:

gem hipchat do
ignore_failure true
action: install
end

http://docs.chef.io/resource_common.html#attributes


Xabier de Zuazo
IT System Administrator - Onddo Labs S.L.
www.onddo.com

Public Key = http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468