Dan White
2012-Jan-23 16:07 UTC
[Puppet Users] Another Discovered/Undocumented feature of yumrepo - and a workaround
I was working with yumrepo, defining new entried and seeing them appear in /etc/yum.repos.d After considerable tinkering, and with the sad discovery that resource { ''yumrepo'': purge => true } does not work, I moved my working /etc/yum.repos.d to /etc/yum.repos.d-old and re-ran my catalog. To my surprise, the repo entried were appended to /etc/yum.conf Long story short: I needed to add file { ''/etc/yum.repos.d'': ensure => directory, } -- require => File["/etc/yum.repos.d"] -- was added to eack yumrepo resource AND "reposdir=/etc/yum/repos.d" explicitly set in /etc/yum.conf to get what I wanted. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
Gary Larizza
2012-Jan-23 16:24 UTC
Re: [Puppet Users] Another Discovered/Undocumented feature of yumrepo - and a workaround
Hey there, If you''re going through all that, and are trying to get a purge-able directory of resources, would you find it easier to declare the /etc/yum.repos.d directory with purge => true, and then declare your repos as file declarations? An exec of ''yum -makecache'' set to refreshonly => true could be notified by each file resource. Does that help get what you need? On Monday, January 23, 2012, Dan White <ygor@comcast.net> wrote:> I was working with yumrepo, defining new entried and seeing them appearin /etc/yum.repos.d> > After considerable tinkering, and with the sad discovery that resource {''yumrepo'': purge => true } does not work,> I moved my working /etc/yum.repos.d to /etc/yum.repos.d-old and re-ran mycatalog.> > To my surprise, the repo entried were appended to /etc/yum.conf > > Long story short: > I needed to add > file { ''/etc/yum.repos.d'': ensure => directory, } > -- require => File["/etc/yum.repos.d"] -- was added to eack yumreporesource> AND "reposdir=/etc/yum/repos.d" explicitly set in /etc/yum.conf > to get what I wanted. > > “Sometimes I think the surest sign that intelligent life exists elsewherein the universe is that none of it has tried to contact us.”> Bill Waterson (Calvin & Hobbes) > > -- > 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 topuppet-users+unsubscribe@googlegroups.com.> For more options, visit this group athttp://groups.google.com/group/puppet-users?hl=en.> >-- Gary Larizza Professional Services Engineer Puppet Labs -- 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.
R.I.Pienaar
2012-Jan-23 16:26 UTC
Re: [Puppet Users] Another Discovered/Undocumented feature of yumrepo - and a workaround
----- Original Message -----> Hey there, > > If you''re going through all that, and are trying to get a purge-able > directory of resources, would you find it easier to declare the > /etc/yum.repos.d directory with purge => true, and then declare your > repos as file declarations? An exec of ''yum -makecache'' set to > refreshonly => true could be notified by each file resource. > > Does that help get what you need?I''ve tried something along these lines and at least on 2.6.x if you just remove repo files mid run the yum provider gets quite unhappy, logs about missing files etc. having this provider support an ensure => absent option rather than just something that sets enable=0 in the repo would be really nice -- 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.
Dan White
2012-Jan-23 17:49 UTC
Re: [Puppet Users] Another Discovered/Undocumented feature of yumrepo - and a workaround
Yes, I could do it that way and I did before i realized that there was a yumrepo resource. Let me try a different approach: Is there something in the yumrepo resource definition that will let me remove the info from the system ? I can live with just disabling the repo, but I have some rabid security types that want the repo removed entirely. The puppet resource seems geared toward adding repos only. Interesting problem. I am thinking it would be nice to be able to gather all the necessary info from the yum database so that you would know that you have "orphaned" rpm''s. I found the Python-yum api and whipped up a script that lists all packages and their source repo, but it ignores "orphans". Still learning ! ----- Gary Larizza <gary@puppetlabs.com> wrote:> Hey there, > > If you''re going through all that, and are trying to get a purge-able > directory of resources, would you find it easier to declare the > /etc/yum.repos.d directory with purge => true, and then declare your repos > as file declarations? An exec of ''yum -makecache'' set to refreshonly => > true could be notified by each file resource. > > Does that help get what you need? > > On Monday, January 23, 2012, Dan White <ygor@comcast.net> wrote: > > I was working with yumrepo, defining new entried and seeing them appear > in /etc/yum.repos.d > > > > After considerable tinkering, and with the sad discovery that resource { > ''yumrepo'': purge => true } does not work, > > I moved my working /etc/yum.repos.d to /etc/yum.repos.d-old and re-ran my > catalog. > > > > To my surprise, the repo entried were appended to /etc/yum.conf > > > > Long story short: > > I needed to add > > file { ''/etc/yum.repos.d'': ensure => directory, } > > -- require => File["/etc/yum.repos.d"] -- was added to eack yumrepo > resource > > AND "reposdir=/etc/yum/repos.d" explicitly set in /etc/yum.conf > > to get what I wanted. > >“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
Dan White
2012-Jan-23 17:54 UTC
Re: [Puppet Users] Another Discovered/Undocumented feature of yumrepo - and a workaround
----- R.I.Pienaar <rip@devco.net> wrote:> ----- Original Message ----- > > Hey there, > > > > If you''re going through all that, and are trying to get a purge-able > > directory of resources, would you find it easier to declare the > > /etc/yum.repos.d directory with purge => true, and then declare your > > repos as file declarations? An exec of ''yum -makecache'' set to > > refreshonly => true could be notified by each file resource. > > > > Does that help get what you need? > > I''ve tried something along these lines and at least on 2.6.x if you just > remove repo files mid run the yum provider gets quite unhappy, logs about > missing files etc. > > having this provider support an ensure => absent option rather than just > something that sets enable=0 in the repo would be really nice >The "enable=0" option is there, and works, but I am trying to deal with the complete removal of the repo info. I am tinkering with the Python-yum api and I have a script to list packages/repos --------------------------------------------- #!/usr/bin/python -tt # -tt => issue errors about inconsistent tab usage import yum my = yum.YumBase() pkgs = my.rpmdb i=0 for ipkg in sorted(pkgs): apkgs = my.pkgSack.searchPkgTuple(ipkg.pkgtup) if len(apkgs) >= 1: apkg = apkgs[0] print ''Repo: %s - Package: %s'' % (apkg.repoid, ipkg) i += 1 print str(i) + " packages" --------------------------------------------------------------------------- I just need to add some more code because this script would pass over an "orphaned" package. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) -- 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.
Possibly Parallel Threads
- Install RPM package via puppet
- Yumrepo''s subscribe ran before package require Yumrepo?
- yumrepo is missing name attribute in repo files using puppet-0.24.8-4.el5
- 2.7.6 yumrepo not working
- Error: Could not find dependency Yumrepo[puppetlabs-products] for Package[puppet]