- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: only_if conditions key off exit value?
- Date: Fri, 16 Sep 2011 08:42:49 -0700
On Friday, September 16, 2011 at 1:35 AM, Jason J. W. Williams wrote:
>
I'm having some issues with an only_if condition that works on Linux
>
but seems to be having issues on Solaris, and I want to make sure I
>
understand how Chef is handling it.
>
>
I have an only_if as follows:
>
>
only_if "mysql -u root -h localhost -e 'SHOW STATUS;'"
>
>
If the MySQL root user still has no password, the command will succeed
>
and the exit status will be 0. However, if the root user now has a
>
password, the command will fail and the exit status will be 1. My
>
understanding is the the only_if will be True if the exit status from
>
the command is 0. Is this incorrect?
>
>
-J
You've got it right, 0 is true, anything else is false. Running with `-l
debug` might provide more insight into what's going on.
--
Dan DeLeo
Archive powered by MHonArc 2.6.16.