onlyif doesn't seem to be executing
I'm trying to use exec with unless and going in circles. I want to use exec to do a solaris silent install. my exec command is
command => '/usr/sbin/pkgadd -n -r /tmp/response_file -a /tmp/admin_file -d /tmp/te_agent.pkg TWeagent', unless => '/usr/bin/pkginfo | grep TWeagent | wc -l > 0',
This works great if the package is already installed, in that it stops trying to re-install it. But if the package is not installed it doesn't get installed. I can see it executing in debug mode -
Debug: Exec[install_te](provider=posix): Executing check '/usr/bin/pkginfo | grep TWeagent | wc -l > 0' Debug: Executing '/usr/bin/pkginfo | grep TWeagent | wc -l > 0'
but that's it. no execute. Can someone please tell me what I'm doing wrong? If I take out the unless line it will install, but it will install every time puppet runs.