On Apr 28, 2007, at 2:37 PM, Jos Backus wrote:
> One particular use of Puppet would be to serve as a machine fact/
> configuration
> retrieval tool. So in order to produce a list of packages with
> version-release
> info installed on each machine something along the lines of the
> following code
> could be run:
>
> require ''puppet''
>
> Puppet::Type.type(:package).defaultprovider.list.each do |package|
> puts "#{package[:name]}-#{package[:ensure]}"
> end
>
> Question: is this something the pelementserver is supposed to be
> able to help
> with or should I look into using/extending the XML-RPC interface?
> I''m still
> trying to wrap my head around all the classes/modules available.
This is exactly what the pelementserver handler was developed for (it
has since been renamed to ''resource'', for obvious reasons).
If you want to create a tool to do this, I''ll do anything I can to
help, since it would really help to show off the flexibility of the
framework we have.
As it stands now, the Resource handler supports three methods --
list, describe, and apply.
List accepts a resource type and returns a TransObject for each found
resource of that type (I just changed the code to return the whole
resource -- 0.22.3 and before just returned the type and title).
Describe accepts a type and title and returns a TransObject
describing the resource, if possible.
Apply accepts a TransObject or TransBucket (containing TransObjects)
and applies it. This was all developed before we had transaction
reports, so the return should be a report but is not.
Like I said, I''ll do what I can to help, since I''d love to see
development in this area.
Oh, and the only security we have in this area is the
namespaceauth.conf file -- clients will refuse to start in --listen
mode without it. If you have any interest in developming some kind
of RBAC, I''m all for it, I just didn''t want to bother until
there was
some interest in using this code.
--
The only difference between the Democrats and the Republicans is that
the Democrats allow the poor to be corrupt, too. -- Oscar Levant
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com