trey85stang
2012-Aug-07 22:46 UTC
[Puppet Users] update yumrepo followed by packages updates.
Hey All, I have an issue I need help working around or determining if it is a bug.... the issue is as follows, I have a custom repo(s) that has all my software for a specific version release in it. A new version gets a new repo. The problem lies when I move to upgrade software. My idea was to have a a simple version variable in an external nodes script. When that changed the repo would change... and all my software would be updated. The problem lies that for some reason I need to puppet restarts to make this work?? example class repos { yumrepo { "custom_app": descr => "custom_app", baseurl => "http://reporserver/\$releasever/application-${::VERSION}/\$basearch", gpgkey => "http://reposerver/RPM-GPG-KEY-Interop", enabled => 1, gpgcheck => 1 } } class packages { include repos package { "custom_app_rpm1": ensure => latest, require => Yumrepo["custom_app"], } package { "custom_app_rpm2": ensure => latest, require => Yumrepo["custom_app"], } } This is just a snippet... Issue: 1) I update my VERSION variable 2) the next puppet run and only updates the repo (no rpms are upgraded) 3) next puppet run updates the rpms. There are no errors. but shouldn''t my rpms update on the first run after the variable change? Any ideas? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/jS4yhakSc-AJ. 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
2012-Aug-08 14:37 UTC
[Puppet Users] Re: update yumrepo followed by packages updates.
On Tuesday, August 7, 2012 5:46:31 PM UTC-5, trey85stang wrote:> > Hey All, > > I have an issue I need help working around or determining if it is a > bug.... > > the issue is as follows, I have a custom repo(s) that has all my software > for a specific version release in it. A new version gets a new repo. > > The problem lies when I move to upgrade software. My idea was to have a a > simple version variable in an external nodes script. When that changed the > repo would change... and all my software would be updated. The problem lies > that for some reason I need to puppet restarts to make this work?? > > example > > class repos { > yumrepo { "custom_app": > descr => "custom_app", > baseurl => " > http://reporserver/\$releasever/application-${::VERSION}/\$basearch", > gpgkey => "http://reposerver/RPM-GPG-KEY-Interop", > enabled => 1, > gpgcheck => 1 > } > } > > class packages { > include repos > package { "custom_app_rpm1": > ensure => latest, > require => Yumrepo["custom_app"], > } > package { "custom_app_rpm2": > ensure => latest, > require => Yumrepo["custom_app"], > } > } > > This is just a snippet... > > Issue: > 1) I update my VERSION variable > 2) the next puppet run and only updates the repo (no rpms are upgraded) > 3) next puppet run updates the rpms. > > There are no errors. but shouldn''t my rpms update on the first run after > the variable change? >If you are certain that the repo configuration is updated on the first run, and if the Package resources indeed do ''require'' the appropriate Yumrepo resource, then the most likely problem is Yum''s metadata caching. After you change the configuration of an existing Yum repository you need to perform a "yum clean metadata" or "yum clean all" to ensure that Yum will notice the changes immediately. If you do not do so then you have to wait for the repo''s cached metadata to expire. I use something like this: exec { "clean_yum_metadata": command => "/usr/bin/yum clean metadata", refreshonly => true } declared on every node. My Package resources all ''require'' that Exec, either explicitly or via a resource default, and my Yumrepo resources all notify it. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/TRED3XhE2TEJ. 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.
Kristof Willaert
2012-Aug-08 14:41 UTC
Re: [Puppet Users] update yumrepo followed by packages updates.
Hi, Issue:> 1) I update my VERSION variable > 2) the next puppet run and only updates the repo (no rpms are upgraded) > 3) next puppet run updates the rpms. > > There are no errors. but shouldn''t my rpms update on the first run after > the variable change? >not sure if this causes it, but yum by default caches the metadata for 6 hours. You can tune this with the ''metadata_expire'' directive in your repo definition (and the corresponding ''metadata_expire'' attribute for the yumrepo type). On the other hand, the change to the yumrepo should trigger yum to pull in the new metadata. But if yum determines the local metadata is younger than the remote, it doesn''t update the local metadata. I normally use "metadata_expire => ''10m''" for my internal repositories, well below the puppet runinterval. Kind regards, kristof -- 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.
trey85stang
2012-Aug-13 19:20 UTC
[Puppet Users] Re: update yumrepo followed by packages updates.
Thanks for the replies. I will give them metadata_expire option a try and if that doesnt work.. ill just execute a yum clean all with every internal repo update. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/FQTPajbMirIJ. 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.
trey85stang
2012-Aug-14 14:07 UTC
[Puppet Users] Re: update yumrepo followed by packages updates.
Well no go with metadata_expire or a yum clean all after updating the repo. This appears to be a bug of some sort. Debugging output shows before any packages checked this output: debug: Prefetching yum resources for package debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm --version'' debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -qa --nosignature --nodigest --qf ''%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} '''' debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/python /usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yumhelper.py'' I am thinking puppet somehow uses this information throughout the puppet run, to verify packages are the latest. The obvious problem is this doesnt get updated if a repo is updated. Hopefully I can get this worded correctly and into a bug report. On Monday, August 13, 2012 2:20:37 PM UTC-5, trey85stang wrote:> > Thanks for the replies. I will give them metadata_expire option a try and > if that doesnt work.. ill just execute a yum clean all with every internal > repo update. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/H8lKCaEv-cUJ. 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.
trey85stang
2012-Aug-14 14:20 UTC
[Puppet Users] Re: update yumrepo followed by packages updates.
dohh... I just realized this host had 2.6 installed... not 2.7. Everything works fine on 2.7. On Tuesday, August 14, 2012 9:07:39 AM UTC-5, trey85stang wrote:> > Well no go with metadata_expire or a yum clean all after updating the > repo. This appears to be a bug of some sort. Debugging output shows > before any packages checked this output: > > debug: Prefetching yum resources for package > debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm --version'' > debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -qa > --nosignature --nodigest --qf ''%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} > %{RELEASE} > %{ARCH} > > '''' > > debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/python > /usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yumhelper.py'' > > I am thinking puppet somehow uses this information throughout the puppet > run, to verify packages are the latest. The obvious problem is this > doesnt get updated if a repo is updated. Hopefully I can get this worded > correctly and into a bug report. > > On Monday, August 13, 2012 2:20:37 PM UTC-5, trey85stang wrote: >> >> Thanks for the replies. I will give them metadata_expire option a try >> and if that doesnt work.. ill just execute a yum clean all with every >> internal repo update. >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Nqy9xmmEv-kJ. 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
2012-Aug-15 15:10 UTC
[Puppet Users] Re: update yumrepo followed by packages updates.
On Tuesday, August 14, 2012 9:07:39 AM UTC-5, trey85stang wrote:> > Well no go with metadata_expire or a yum clean all after updating the > repo. This appears to be a bug of some sort. Debugging output shows > before any packages checked this output: > > debug: Prefetching yum resources for package > debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm --version'' > debug: Puppet::Type::Package::ProviderYum: Executing ''/bin/rpm -qa > --nosignature --nodigest --qf ''%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} > %{RELEASE} > %{ARCH} > > '''' > > debug: Puppet::Type::Package::ProviderYum: Executing ''/usr/bin/python > /usr/lib/ruby/site_ruby/1.8/puppet/provider/package/yumhelper.py'' > > I am thinking puppet somehow uses this information throughout the puppet > run, to verify packages are the latest. The obvious problem is this > doesnt get updated if a repo is updated. Hopefully I can get this worded > correctly and into a bug report.That''s determining what packages are already installed. Yes, the information will be used throughout the run, but it does not depend on the configured repos (in fact, note that it''s not even running ''yum'' itself, but rather ''rpm''). None of that is buggy. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VR3b58RDSdMJ. 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.