I''m trying to use something like this... package { "blah": ensure => "1.2.3*" } ...and I know that doesn''t work because it looks for a package literally with that value "1.2.3*". What I want is to say, install the latest package in the 1.2.3 branch but don''t automatically upgrade to anything later than that. e.g. 1.2.3-01, 1.2.3-05 are fine if I find them in the REPO....but not 1.2.4 or later. I''m sure there''s a way to do this with a regex or something, but I''ve not been able to find any examples in my searches so far. Thanks, Matt -- 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.
Jacob Helwig
2011-Nov-18 19:37 UTC
Re: [Puppet Users] Using regex to ensure package version
On 2011-11-18 08:37 , Matt wrote:> I''m trying to use something like this... > > package { "blah": ensure => "1.2.3*" } > > ...and I know that doesn''t work because it looks for a package > literally with that value "1.2.3*". What I want is to say, install > the latest package in the 1.2.3 branch but don''t automatically upgrade > to anything later than that. > > e.g. 1.2.3-01, 1.2.3-05 are fine if I find them in the REPO....but not > 1.2.4 or later. > > > I''m sure there''s a way to do this with a regex or something, but I''ve > not been able to find any examples in my searches so far. > > Thanks, > Matt >Puppet doesn''t have a way to do that. The way the package type & providers are setup they will always compare literal strings. Typically how people have handled this is by ensuring ''latest'', but managing the repository that the machine will pull the packages from so that it will only ever contain something in the 1.2.3 series. -- Jacob Helwig http://about.me/jhelwig
Hi, you can also use puppet to ''pin'' the version by managing the apt or yum configs on the host. You should find the details in the man pages on how to do it. See if that is what you''re looking for? Den On 19/11/2011, at 6:37, Jacob Helwig <jacob@puppetlabs.com> wrote:> On 2011-11-18 08:37 , Matt wrote: >> I''m trying to use something like this... >> >> package { "blah": ensure => "1.2.3*" } >> >> ...and I know that doesn''t work because it looks for a package >> literally with that value "1.2.3*". What I want is to say, install >> the latest package in the 1.2.3 branch but don''t automatically upgrade >> to anything later than that. >> >> e.g. 1.2.3-01, 1.2.3-05 are fine if I find them in the REPO....but not >> 1.2.4 or later. >> >> >> I''m sure there''s a way to do this with a regex or something, but I''ve >> not been able to find any examples in my searches so far. >> >> Thanks, >> Matt >> > > Puppet doesn''t have a way to do that. The way the package type & > providers are setup they will always compare literal strings. > > Typically how people have handled this is by ensuring ''latest'', but > managing the repository that the machine will pull the packages from so > that it will only ever contain something in the 1.2.3 series. > > -- > Jacob Helwig > http://about.me/jhelwig >-- 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.