Tony G.
2010-Apr-09 19:52 UTC
[Puppet Users] Yum provider using version-release as version?
Hi, I''m using yum as our package provider and having an issue. Puppet is complaining of the version, this is the code I''m trying to implement: $snmp_version = "5.3.2.2" package { "net-snmp": ensure => "${snmp_version}"; } On the client I got: debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: Changing ensure debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: 1 change(s) debug: Package[net-snmp](provider=yum): Ensuring => 5.3.2.2 debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/yum -d 0 -e 0 -y install net-snmp-5.3.2.2'' *(1)* debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -q net-snmp --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} '' *(2)* err: //Node[client.example.com]/snmp::base/Package[net-snmp]/ensure: change from 5.3.2.2-7.el5_4.2 to 5.3.2.2 failed: Could not update: Failed to update to version *5.3.2.2*, got version *5.3.2.2-7.el5_4.2* instead at /opt/git/development/modules/snmp/manifests/init.pp:26 notice: //Node[client.example.com]/snmp::base/File[/etc/snmp/snmpd.conf]: Dependency package[net-snmp] has 1 failures warning: //Node[labtest40-v3.ea-colo.ea.com]/snmp::base/File[/etc/snmp/snmpd.conf]: Skipping because of failed dependencies The package is installed*(1)* but the error is still shown at the time of validation*(2)*. Looking at the code I found: in .../provider/package/yum.rb: def install ---- chop lines --- * is = self.query* unless is raise Puppet::Error, "Could not find package %s" % self.name end # FIXME: Should we raise an exception even if should == :latest # and yum updated us to a version other than @param_hash[:ensure] ? if should && should != is[:ensure] raise Puppet::Error, "Failed to update to version #{*should*}, got version #{*is[:ensure]*} instead" end in .../provider/package/rpm.rb the query define comment says it will provide the "version-release" # Find the fully versioned package name and the version alone. Returns # a hash with entries :instance => fully versioned package name, and #* :ensure => version-release* *def query* The validation is made on what is provided in the ensure attribute($snmp_version) against "version-release" installed. I think it makes sense when somebody defines something like ensure => "${snmp_version}-${snmp-release}", but not in my use case. I would like to hear comments of my use case as it could probably would be a valid feature request. Thanks! I''m Running(still) 0.24.8 on client and master. -- Tony -- 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.
Ken
2010-Apr-10 00:36 UTC
[Puppet Users] Re: Yum provider using version-release as version?
FYI - this still behaves like this in 0.25.4 [root@obelisk ~]# puppetd -t --environment=prod info: Retrieving plugin info: Caching catalog for obelisk.usr.bob.sh info: Applying configuration version ''1270859745'' err: //Node[obelisk.usr.bob.sh]/Package[git]/ensure: change from 1.6.6.1-1.fc12 to 1.6.6.1 failed: Could not update: Failed to update to version 1.6.6.1, got version 1.6.6.1-1.fc12 instead at /etc/puppet/ prod/manifests/nodes_usr.pp:14 notice: Finished catalog run in 3.39 seconds [root@obelisk ~]# puppet --version 0.25.4 [root@obelisk ~]# I wonder Tony if a regexp would be nice for providing the most flexible version selection criteria. Thoughts? ken. On Apr 9, 8:52 pm, "Tony G." <tony...@gmail.com> wrote:> Hi, > > I''m using yum as our package provider and having an issue. Puppet is > complaining of the version, this is the code I''m trying to implement: > > $snmp_version = "5.3.2.2" > package { "net-snmp": ensure => "${snmp_version}"; } > > On the client I got: > debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: Changing > ensure > debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: 1 change(s) > debug: Package[net-snmp](provider=yum): Ensuring => 5.3.2.2 > debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/yum -d 0 -e 0 > -y install net-snmp-5.3.2.2'' *(1)* > debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -q net-snmp > --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} > %{RELEASE} %{ARCH} > '' *(2)* > err: //Node[client.example.com]/snmp::base/Package[net-snmp]/ensure: change > from 5.3.2.2-7.el5_4.2 to 5.3.2.2 failed: Could not update: Failed to update > to version *5.3.2.2*, got version *5.3.2.2-7.el5_4.2* instead at > /opt/git/development/modules/snmp/manifests/init.pp:26 > notice: //Node[client.example.com]/snmp::base/File[/etc/snmp/snmpd.conf]: > Dependency package[net-snmp] has 1 failures > warning: //Node[labtest40-v3.ea-colo.ea.com]/snmp::base/File[/etc/snmp/snmpd.conf]: > Skipping because of failed dependencies > > The package is installed*(1)* but the error is still shown at the time of > validation*(2)*. > > Looking at the code I found: > > in .../provider/package/yum.rb: > def install > ---- chop lines --- > > * is = self.query* > unless is > raise Puppet::Error, "Could not find package %s" % self.name > end > > # FIXME: Should we raise an exception even if should == :latest > # and yum updated us to a version other than @param_hash[:ensure] ? > if should && should != is[:ensure] > raise Puppet::Error, "Failed to update to version #{*should*}, got > version #{*is[:ensure]*} instead" > end > > in .../provider/package/rpm.rb the query define comment says it will provide > the "version-release" > # Find the fully versioned package name and the version alone. Returns > # a hash with entries :instance => fully versioned package name, and > #* :ensure => version-release* > *def query* > > The validation is made on what is provided in the ensure > attribute($snmp_version) against "version-release" installed. I think it > makes sense when somebody defines something like ensure => > "${snmp_version}-${snmp-release}", but not in my use case. > > I would like to hear comments of my use case as it could probably would be a > valid feature request. > > Thanks! > > I''m Running(still) 0.24.8 on client and master. > > -- > Tony-- 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.
Michael DeHaan
2010-Apr-10 20:51 UTC
Re: [Puppet Users] Re: Yum provider using version-release as version?
On Fri, Apr 9, 2010 at 8:36 PM, Ken <ken@bob.sh> wrote:> FYI - this still behaves like this in 0.25.4 > > [root@obelisk ~]# puppetd -t --environment=prod > info: Retrieving plugin > info: Caching catalog for obelisk.usr.bob.sh > info: Applying configuration version ''1270859745'' > err: //Node[obelisk.usr.bob.sh]/Package[git]/ensure: change from > 1.6.6.1-1.fc12 to 1.6.6.1 failed: Could not update: Failed to update > to version 1.6.6.1, got version 1.6.6.1-1.fc12 instead at /etc/puppet/ > prod/manifests/nodes_usr.pp:14 > notice: Finished catalog run in 3.39 seconds > [root@obelisk ~]# puppet --version > 0.25.4 > [root@obelisk ~]# > > I wonder Tony if a regexp would be nice for providing the most > flexible version selection criteria. Thoughts? > > ken. > > On Apr 9, 8:52 pm, "Tony G." <tony...@gmail.com> wrote: >> Hi, >> >> I''m using yum as our package provider and having an issue. Puppet is >> complaining of the version, this is the code I''m trying to implement: >> >> $snmp_version = "5.3.2.2" >> package { "net-snmp": ensure => "${snmp_version}"; } >> >> On the client I got: >> debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: Changing >> ensure >> debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: 1 change(s) >> debug: Package[net-snmp](provider=yum): Ensuring => 5.3.2.2 >> debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/yum -d 0 -e 0 >> -y install net-snmp-5.3.2.2'' *(1)* >> debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -q net-snmp >> --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} >> %{RELEASE} %{ARCH} >> '' *(2)* >> err: //Node[client.example.com]/snmp::base/Package[net-snmp]/ensure: change >> from 5.3.2.2-7.el5_4.2 to 5.3.2.2 failed: Could not update: Failed to update >> to version *5.3.2.2*, got version *5.3.2.2-7.el5_4.2* instead at >> /opt/git/development/modules/snmp/manifests/init.pp:26 >> notice: //Node[client.example.com]/snmp::base/File[/etc/snmp/snmpd.conf]: >> Dependency package[net-snmp] has 1 failures >> warning: //Node[labtest40-v3.ea-colo.ea.com]/snmp::base/File[/etc/snmp/snmpd.conf]: >> Skipping because of failed dependencies >> >> The package is installed*(1)* but the error is still shown at the time of >> validation*(2)*. >> >> Looking at the code I found: >> >> in .../provider/package/yum.rb: >> def install >> ---- chop lines --- >> >> * is = self.query* >> unless is >> raise Puppet::Error, "Could not find package %s" % self.name >> end >> >> # FIXME: Should we raise an exception even if should == :latest >> # and yum updated us to a version other than @param_hash[:ensure] ? >> if should && should != is[:ensure] >> raise Puppet::Error, "Failed to update to version #{*should*}, got >> version #{*is[:ensure]*} instead" >> end >> >> in .../provider/package/rpm.rb the query define comment says it will provide >> the "version-release" >> # Find the fully versioned package name and the version alone. Returns >> # a hash with entries :instance => fully versioned package name, and >> #* :ensure => version-release* >> *def query* >> >> The validation is made on what is provided in the ensure >> attribute($snmp_version) against "version-release" installed. I think it >> makes sense when somebody defines something like ensure => >> "${snmp_version}-${snmp-release}", but not in my use case. >> >> I would like to hear comments of my use case as it could probably would be a >> valid feature request. >> >> Thanks! >> >> I''m Running(still) 0.24.8 on client and master. >> >> -- >> Tony >Hmmm. let''s step back a moment before we discuss implementation or changes. I want to understand the problem a little better. What package did you have installed before running the command (I assume none, right?), and what packages are in your yum repo (full name of package)? I think you''re saying that Puppet isn''t comparing installed packages quite the way yum does, and that yum would be able to find the match if executed with just the version and not the release, right? --Michael -- 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.
Ken
2010-Apr-10 21:33 UTC
[Puppet Users] Re: Yum provider using version-release as version?
> let''s step back a moment before we discuss implementation or changes.There''s little harm in being conceptual - especially when I won''t have to implement it :-).> What package did you have installed before running the command (I > assume none, right?), and what packages are in your yum repo (full > name of package)?In both mine and Tony''s case - the packages are already installed on the system (you can see this commented in Tony''s post).> I think you''re saying that Puppet isn''t comparing installed packages > quite the way yum does, and that yum would be able to find the match > if executed with just the version and not the release, right?Yes this is correct. Its all about being less precise in your match. ken. -- 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.
Tony G.
2010-Apr-11 03:21 UTC
Re: [Puppet Users] Re: Yum provider using version-release as version?
Hi On Sat, Apr 10, 2010 at 2:33 PM, Ken <ken@bob.sh> wrote:> > let''s step back a moment before we discuss implementation or changes. > > There''s little harm in being conceptual - especially when I won''t have > to implement it :-). > > > What package did you have installed before running the command (I > > assume none, right?), and what packages are in your yum repo (full > > name of package)? > > In both mine and Tony''s case - the packages are already installed on > the system (you can see this commented in Tony''s post). >Actually both situations (not having the package installed _and_ having it already installed) cause the Error. If the package is not installed, puppet _will_ install it but at the time of validation it will print out the Error as it does not match, if the package is already installed it will print out the Error too as the "ensure" string(the version only) does not match the version-release that puppet constructs in the query define of the rpm.rb.> > > I think you''re saying that Puppet isn''t comparing installed packages > > quite the way yum does, and that yum would be able to find the match > > if executed with just the version and not the release, right? > > Yes this is correct. Its all about being less precise in your match. > > ken. > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Tony -- 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.
Ken
2010-Apr-11 21:15 UTC
[Puppet Users] Re: Yum provider using version-release as version?
> Actually both situations (not having the package installed _and_ having it > already installed) cause the Error. If the package is not installed, puppet > _will_ install it but at the time of validation it will print out the Error > as it does not match, if the package is already installed it will print out > the Error too as the "ensure" string(the version only) does not match the > version-release that puppet constructs in the query define of the rpm.rb.Yeah I''ve definitely been surprised by this before - the behaviour is ambiguous enough, you should raise a bug. ken. -- 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.
Michael DeHaan
2010-Apr-12 14:00 UTC
Re: [Puppet Users] Re: Yum provider using version-release as version?
>> I think you''re saying that Puppet isn''t comparing installed packages >> quite the way yum does, and that yum would be able to find the match >> if executed with just the version and not the release, right? > > Yes this is correct. Its all about being less precise in your match. >Ok, I agree this is a bug. Please file one if there isn''t one already. I don''t think we need a new regex matching parameter or anything, just that the internals of the provider do not seem to be correct when they don''t work the same way as the yum CLI. --Michael -- 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.
Tony G.
2010-Apr-12 19:02 UTC
Re: [Puppet Users] Re: Yum provider using version-release as version?
Didn''t find a bug related to this, I have created: http://projects.puppetlabs.com/issues/3538 Thanks On Mon, Apr 12, 2010 at 7:00 AM, Michael DeHaan <michael@puppetlabs.com>wrote:> >> I think you''re saying that Puppet isn''t comparing installed packages > >> quite the way yum does, and that yum would be able to find the match > >> if executed with just the version and not the release, right? > > > > Yes this is correct. Its all about being less precise in your match. > > > > Ok, I agree this is a bug. Please file one if there isn''t one already. > > I don''t think we need a new regex matching parameter or anything, just > that the internals of the provider do not seem to be correct when they > don''t work the same way as the yum CLI. > > --Michael > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- Tony -- 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.