----- R.I.Pienaar <[email protected]> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.