[Pkg-puppet-devel] Bug#529555: onlyif + unless precedence

Micah Anderson micah at riseup.net
Sat Sep 29 21:41:21 UTC 2012


> http://reductivelabs.com/trac/puppet/wiki/TypeReference#exec
> onlyif
> If this parameter is set, then this exec will only run if the command returns 0.
> unless
> If this parameter is set, then this exec will run unless the command returns 0.
> 
> So, If I specify something like:
>   exec {
>     "rm /usr/share/man/man1/x-window-manager.1.gz":
>       onlyif => "test -L /usr/share/man/man1/x-window-manager.1.gz",
>       unless => "stat -L /usr/share/man/man1/x-window-manager.1.gz",
>       path => "/usr/bin:/usr/sbin:/bin";
>   }
> 
> Or what if x-window-manager.1.gz doesn't exist?  The onlyif and unless commands both return non-zero.  the unless parameter says to run the exec command, but the onlyif says not to run it.

I confess, I dont understand what it is you are trying to do. Could you clarify
a little bit?

Also, have you tried this in a newer version of puppet? You reported this when
puppet was at 0.24, and things have changed significantly since then. It would
be good to know if this is still an issue in newer versions.

thanks,
micah
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20120929/d95dbe8b/attachment.pgp>


More information about the Pkg-puppet-devel mailing list