So this is really getting to me and I can't seem to figure it out.

>From the documents:

> unlessIf this parameter is set, then this exec will run unless the command
> returns 0
>

I interpret this to be the return value of the command and not the output of
the command.  So if the return value of my command is 0 then the command
will not run, yet I can verify that the return value of the command is 0,
yet it still runs.  Unless I have this backwards and my interpretations are
incorrect.

Thanks,

Drew

On Thu, Feb 25, 2010 at 10:01 AM, Andrew Hamilton <andrew...@gmail.com>wrote:

> This is probably my fault.  I'm doing two different things here. One is
> creating a database if it doesn't exist and the other is creating a user if
> it doesn't exist.  I'm probably mixing the two in my comments though I
> didn't mean to.
>
> My next test was to wrap it in a /usr/bin/test to see if I could normalize
> it somehow.  I think the logic is backward though.  Wrapping it in the
> /usr/bin/test worked, but on subsequent runs tried to create the user
> again.  I changed it to onlyif and it seemed to work to prevent it from
> retrying, but then it wouldn't create it if it didn't exist.  It's like
> something is flipping the logic.
>
> Thanks.
>
>
> On Thu, Feb 25, 2010 at 9:43 AM, Trevor Hemsley <
> trevor.hems...@codefarm.com> wrote:
>
>>  It looks to me like something is replacing your command before it gets
>> executed. I have no idea what could be doing that but  what is being entered
>> as
>>
>>
>> /usr/bin/psql -l | grep '$name *|'
>>
>>
>> is then being changed to
>>
>>
>> /usr/bin/psql -c '\du' | grep 'puser *|'
>>
>>
>> so -l is being changed to -c '\du'. Both of these are valid psql commands.
>>
>>
>> On 25/02/2010 16:34, Andrew Hamilton wrote:
>>
>> I tried Michael's suggestion above and when running it from the command
>> line, it does complete successfully.  It returns 0 when the user exists and
>> 1 when it doesn't.  Does that make sense?  Anyway, inserting the pipe back
>> into it produces the same error as before.  It's perplexing...
>>
>>
>> --
>>
>>  Trevor Hemsley
>>   Infrastructure Engineer
>>   .................................................
>>  * C A L Y P S O
>>  * Brighton, UK
>>
>>   OFFICE +44 (0) 1273 666 350  FAX +44 (0) 1273 666 351
>>
>>  .................................................
>>   www.calypso.com
>>
>>  This electronic-mail might contain confidential information intended
>> only for the use by the entity named. If the reader of this message is not
>> the intended recipient, the reader is hereby notified that any
>> dissemination, distribution or copying is strictly prohibited.
>>
>> * P * * Please consider the environment before printing this e-mail *
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To post to this group, send email to puppet-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/puppet-users?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to