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

Jayen Ashar jayen at science.unsw.edu.au
Wed May 20 03:03:35 UTC 2009


Package: puppet
Version: 0.24.7-2
Severity: normal

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.

-- System Information:
Debian Release: 4.0
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.24-etchnhalf.1-686-bigmem
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)

Versions of packages puppet depends on:
ii  adduser                3.102             Add and remove users and groups
ii  facter                 1.3.5-1           a library for retrieving facts fro
ii  libopenssl-ruby        1.0.0+ruby1.8.2-1 OpenSSL interface for Ruby
ii  libshadow-ruby1.8      1.4.1-7           Interface of shadow password for R
ii  libxmlrpc-ruby         1.8.2-1           XML-RPC support for Ruby
ii  lsb-base               3.1-23.2etch1     Linux Standard Base 3.1 init scrip
ii  ruby                   1.8.2-1           An interpreter of object-oriented 

Versions of packages puppet recommends:
pn  libaugeas-ruby1.8             <none>     (no description available)
ii  rdoc                          1.8.2-1    Generate documentation from ruby s

-- no debconf information





More information about the Pkg-puppet-devel mailing list