Correct Rob, nc is indeed at /usr/bin I added this to path => and
it's now working. I guess the problem is that the ifonly doesn't flag
an error. I was running it in debug mode on the client.
Initially I just replaced /bin with /usr/bin but of course I did get
an error due to it not being able to find tar. [ "/bin", "/usr/bin" ]
solved it.
Thanks for picking up on it.
Matt
2008/12/4 Rob Fay <[EMAIL PROTECTED]>:
>
> I'm using a similar onlyif in 0.24.6 and it's working correctly for me.
>
> Looking at your code, the only thing I can see that might cause it to
> fail is the path. 'nc' is usually under '/usr/bin', so with the path
> set to just '/bin' the onlyif command wouldn't run successfully, if
> that's the case on your clients?
>
> Rob
>
>
> Matt wrote:
>> Haven't tried this in 0.24.5 so not sure if it worked, but i'm trying to do:
>>
>> exec { "tar -zxf ../$dist":
>> cwd => "/opt/app",
>> creates => "/opt/app/lib",
>> require => Exec["get-dist"],
>> path => "/bin",
>> onlyif => "nc -z $otherappdns 10098",
>> before => Exec["somethingelse"],
>> }
>>
>> With the onlyif in place this just runs on the client and fails on a
>> later stage as this tar command actually doesn't run. If I comment
>> out the onlyif it runs through fine.
>>
>> If I substitute $otherappdns with the hardcoded value, it still
>> behaves the same. I've performed the onlyif command on the client and
>> confirmed that 'echo $?' returns a 0.
>>
>> If I switch the onlyif to a unless and change 10098 to 10099 so it
>> doesn't return a 0, then it performs as it should and untars the file.
>>
>> Is this a bug in 0.24.6?
>>
>> Thanks,
>>
>> Matt
>>
>>
> --
> Robert Fay [EMAIL PROTECTED]
> System Administrator office: 220
> High Energy Physics Division tel (int): 43396
> Oliver Lodge Laboratory tel (ext): +44 (0)151 794 3396
> University of Liverpool http://www.liv.ac.uk/physics/hep/
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---