This seems like it would be better solved in a lwrp, lib or straight up provider, but u should be able to throw a Chef::Exception in the ruby block.
From: Jonathan Weiss
Subject: [chef] How to mark a ruby_block as failed?
Sent: Dec 21, 2010 12:20 PM
I’m using a ruby_block to handle complex operations with mdadm in
Chef. My question is, how do I tell Chef that my block failed and
execution should halt with an error? In pseudo code:
ruby_block “A complex operation” do
block “using mdadm” do
# tell chef we failed
This would of course be easier if I could just use the execute
resource in the ruby_block…
Sent via BlackBerry from T-Mobile