Catch exception of resources in chef ? (if resource failed, then do resource instead)


#1

is there a way to catch exceptions of a chef resource ?

like if this resource fails to compile or converge, then this do this other
resource instead ?

while my question is about all resources, I am thinking an example of using
it in Machine resource


#2

Ignore failure attribute suppress the exception. There’s a event handler
hook to detect this and do something. You combine these two to write an
hwrp/lwrp that does what you want. Declare the failure resource with
nothing action, the alter it via event handler
On May 6, 2015 10:55 AM, “Medya” medya.gh@gmail.com wrote:

is there a way to catch exceptions of a chef resource ?

like if this resource fails to compile or converge, then this do this
other resource instead ?

while my question is about all resources, I am thinking an example of
using it in Machine resource