On Sun, Jan 09, 2011 at 09:29:00PM -0800, pl wrote:
> Hi,
> 
> So, after setting pluginsync = true I manage to get this working, but
> only executing correctly as puppetd --test
> 
> Except that it only functions correctly when run as puppetd --test,
> when I run it as the puppet service the custom provider does not do
> anything.
> 
> This seems odd.
> 
> The only notice I have in /var/log/messages is
> 
> "Provider npm has not defined the 'instances' class method"
> 
> Is that required?

Puppet::Provider::Package defines the prefetch class method. This is
called at the beginning of the puppet run to find matches between existing
packages and the one you described in your manifest. Prefetch calls
instances which should return an array of provider instances. One
provider instance for each package with the appropiate property_hash
{ensure => "whatever-version"}. If you dont know how to implement it try
with returning an empty array like hpux.rb does.

The reason for instances is you can use the resource type to purge
not managed packages and prefetech is useful when you can run one
command to query all packages. When the user specified 200 packages you
dont want to run the same query command 200 times to check if the packges is
installed or not when you can easily parse ONE command at the beginning that
lists all packages.

-Stefan

-Stefan

Attachment: pgpewDRVk6wpn.pgp
Description: PGP signature

Reply via email to