Hello all, Is there a way of ensuring a package is newer than a certain version? For instance: sudo only supported the includedir option from around version 1.7.1, and I am trying to ensure that the sudo package is newer than that. However, in Puppet 0.25.5, it doesn''t appear that you can do package { "sudo": ensure => ">=1.7.1", } Am I right? Is there another way of doing this? Calum PS. It would obviously be preferable to test and specify a single version, but we are applying puppet to a large number of existing systems, and as such, we can''t be sure what''s out there, so this is probably the safest option. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-May-17 12:59 UTC
[Puppet Users] Re: Ensure a package is newer than version X
On May 17, 4:56 am, Calum <cal...@gmail.com> wrote:> Hello all, > > Is there a way of ensuring a package is newer than a certain version? > > For instance: > sudo only supported the includedir option from around version 1.7.1, > and I am trying to ensure that the sudo package is newer than that. > > However, in Puppet 0.25.5, it doesn''t appear that you can do > > package { "sudo": > ensure => ">=1.7.1", > > } > > Am I right? Is there another way of doing this?You cannot express such a requirement directly in Puppet. You can, however, write ensure => "latest" which will give you a version >= 1.7.1 if one is available (but will not fail otherwise). Depending on which package management systems are involved, you may also be able to create a custom package(s) that has the requirement you want, and use that to indirectly inforce your requirement: package { "sudo-min-version": ensure => "1.7.1" } That does suppose that you maintain your own package repository, at least for custom packages (recommended). That has the advantages of expressing the minimum version explicitly in your manifests, and of failing where the desired minimum cannot be satisfied. It can be used as either a supplement or an alternative to Package["sudo"]. Cheers, John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Calum
2011-May-17 13:51 UTC
Re: [Puppet Users] Re: Ensure a package is newer than version X
On 17 May 2011 13:59, jcbollinger <John.Bollinger@stjude.org> wrote:> You cannot express such a requirement directly in Puppet. You can, > however, write > > ensure => "latest"That will update packages that don''t "need" to be updated though - i.e. ones that are newer than 1.7.1 but not at the latest.> package { "sudo-min-version": > ensure => "1.7.1" > }That is probably the way we''ll go for it. Many thanks for the idea. Calum -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Doug Warner
2011-May-17 19:37 UTC
Re: [Puppet Users] Re: Ensure a package is newer than version X
On 05/17/2011 09:51 AM, Calum wrote:> On 17 May 2011 13:59, jcbollinger <John.Bollinger@stjude.org> wrote: >> You cannot express such a requirement directly in Puppet. You can, >> however, write >> >> ensure => "latest" > > That will update packages that don''t "need" to be updated though - > i.e. ones that are newer than 1.7.1 but not at the latest. > >> package { "sudo-min-version": >> ensure => "1.7.1" >> } > > That is probably the way we''ll go for it. > > Many thanks for the idea. > > Calum >On Gentoo we would handle this by putting a mask in place to mask versions < 1.7.1, then just ensure => installed on the package. -Doug
Felix Frank
2011-May-24 10:26 UTC
Re: [Puppet Users] Re: Ensure a package is newer than version X
On 05/17/2011 09:37 PM, Doug Warner wrote:> On Gentoo we would handle this by putting a mask in place to mask versions < > 1.7.1, then just ensure => installed on the package.Come to think of it, Debian would do this using apt pinning. There are probably yum/zypper counterparts for the RPM world. Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Check out yum-versionlock for RHEL/CentOS, its a yum plugin. We use it to lock down versions and then just have ensure => latest in our manifests.. Regards, Josh On May 24, 8:26 pm, Felix Frank <felix.fr...@alumni.tu-berlin.de> wrote:> On 05/17/2011 09:37 PM, Doug Warner wrote: > > > On Gentoo we would handle this by putting a mask in place to mask versions < > > 1.7.1, then just ensure => installed on the package. > > Come to think of it, Debian would do this using apt pinning. > > There are probably yum/zypper counterparts for the RPM world. > > Cheers, > Felix-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.