Reid Vandewiele
If you know that a version of a package is bad and want to be higher:
package { 'foo': ensure=>'>1.0' }
|
If the expression fails, install the latest available version.
If you've verified that a particular version is good and want to be at that or above, but another process (e.g. patching) can increase the version and you don't want Puppet to downgrade it with an explicit ensure=>$VERSION:
package { 'foo': ensure=>'>=1.0' }
|
If the expression fails, install the latest available version. (This is what I want more anything else. We don't want Puppet downgrading packages, or having to continually update our package definitions whenever patching releases a new package to the internal repos.)
If you have a maximum version you'd like installed, and have verified anything higher will cause problems:
package { 'foo': ensure=>'<=1.0' }
|
If the expression fails, downgrade the package to 1.0 (or install 1.0 if it's not installed yet).
If you know there's a particular version that has problems and you'd like to make sure Puppet does not upgrade to that version:
package { 'foo': ensure=>'<1.0' }
|
If the expression fails, install the highest version available that's below 1.0. I'm not sure if this has an actual valid use case, but it might be good to have all possible comparison operators working. I don't think I would use it (verifying a "highest known good" seems more concrete than "upgrade, but not to this one"), but others might find it helpful.
If these four are all in operation, then you can easily define a range of acceptable versions:
package { 'foo': ensure=>'>1.0' }
|
package { 'foo': ensure=>'<=1.7' }
|
The package version must be greater than 1.0 but no greater than 1.7. In this case, Puppet should install version 1.7 if the package is not installed or currently below 1.0, but leave the current installation alone if both conditions are already met. "Latest available" in greater-than will be overridden by the assertion that the installed package cannot be greater than 1.7.
|