- From: Cassiano Leal <
>
- To:
- Subject: [chef] Re: How to execute a command block only if previous block succeed?
- Date: Mon, 20 May 2013 14:26:07 -0300
You're asking two different questions here, and the solution will depend on which is actually the case.
If you really just need for one resource to be dependent on the other, use the action :nothing / notifies pattern:
execute "bye" do
command "xxx"
action :nothing
end
…
foo "bar" do
action :helloworld
notifies :run, "execute[bye]"
end
If you actually need to send the exit status from one resource to the other, then you'll probably need to hack something on your provider to populate a node attribute, I think… :)
On Monday, May 20, 2013 at 14:22, howard chen wrote:
I have written a custom provider, foo
action :helloworld do
...
end
And in my recipe, I have lines..
foo "bar" do
action : helloworld
end
..
..
execute "bye" do
command "xxx"
action :run
end
How to make my last execute block run only if my custom provider "foo" is executed correctly?
i.e. How to make my helloworld action return success/error status and such that the later block can make use of this value?
Thanks.
Archive powered by MHonArc 2.6.16.