- From: <
>
- To:
- Subject: [chef] Is there mechanism in Chef to capture return value of the command executed using "execute resource"?
- Date: Mon, 11 Mar 2013 07:48:43 -0700 (PDT)
Is there mechanism in Chef to capture return value of the command executed
using "execute resource"?
For example, consider I am calling following resource in some recipe.
execute "execute_foo" do
command "foo" <<< "foo" is executable which returns some value. It
could
be string or number.
end
Based on the return value of "foo", I should decide whether to execute
following resources or not !
if 'foo' returns "apple"
execute "apple"
if 'foo' returns "tomato"
execute "tomato"
etc . . .
I try to use notify, only_if or not_if clauses but couldn't develop logic
around it. As per my understanding those do binary comparison based on true or
false return value.
I want to achieve something like below -
if (foo() == apple)
print fruit
else if(foo() == tomato)
print vegetable
else if ...
Thanks,
Aditya
- [chef] Is there mechanism in Chef to capture return value of the command executed using "execute resource"?, adityanitsure, 03/11/2013
Archive powered by MHonArc 2.6.16.