Issue #21213 has been reported by Steve Shipway.

----------------------------------------
Feature #21213: Extend package resource to add 'onlyif' parameter
https://projects.puppetlabs.com/issues/21213

* Author: Steve Shipway
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: package
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
Sometimes, we want to upgrade a package to the latest version, but only if it 
is already installed.  This would be  in the case of a patch becoming available 
for a vulnerability in a package not installed everywhere.  We could add a 
resource to a global include to ensure it is patched on only the servers that 
require it.

So, we cant use package{foo: ensure=>latest} as this would install the package 
if it is not already there.

I would like something along the lines of

package { foo: ensure=>latest, onlyif=>present }

so that the package is upgraded but only if it is already installed in an older 
version.  You could maybe also have "onlyif=>'<1.0'" to only trigger the 
upgrade if you have an existing version older than 1.0 (though this would be 
covered by the other feature request to allow "ensure=>'>1.0'")

Yes, this could be done with a custom fact, but that is very cumbersome if you 
have a large and changing set of packages - do you add a fact for each one?  It 
can also be done (on yum-based systems but not apt-based ones) via a complex 
exec definition.  However it would be better to have it all done in the package 
resource.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to