On Dec 7, 2009, at 6:52 AM, Andrew Forgue wrote: > I'm running into an issue with the package provider that I wrote for > AIX. When the provider checks for the latest version of a package, it > calls out to the Network install manager (NIM) server which returns > the latest list of *all* packages for that installation source. > > The problem is I don't know how to pre-fetch all available sources > since some sources the client will not ever want to use (i.e. the > source contains packages meant for a different major version of the > operating system AIX 5.3 vs AIX 6.1), and doing an ensure => latest > would upgrade the entire OS if the dependencies said to. > > My question is, on the first call to ensure => latest for a given > @resource[:source] is there a way to add to the prefetched packages > after the pre fetching occurred? > > Something like this: > > 1.) puppet run starts > 2.) Packages are pre-fetched (provider doesn't prefetch anything, > because it can't) > 3.) Puppet checks latest version for ensure => latest on a package > 4.) Provider checks latest version (which incidentally returns the > latest versions of all packages for that source) > > Is there a way to take the information in step 4 and merge it with the > existing prefetch list?
As Peter said, copy the yum provider for this. But in general, no; your provider has to notice that some resources specify 'latest' and then prefetch the extra information for them based on this. It all has to be done in that first prefetch call, though. -- Charm is a way of getting the answer yes without asking a clear question. -- Albert Camus --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com -- You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.
