Good afternoon. I've just started playing with puppet, and I'm
currently stuck trying to figure out how to accomplish the following:

I want to add a property to the package type resource, so if one is on
a debian-based system they can specify from which "release" to install
a package and it's dependencies. This is something I believe would
come in handy, especially to make it easier for admins to manage
packages coming from a combination of private/custom repos plus debian-
backports and/or testing repos.

So, for example, in one's manifest would be the following:

package {
    "pupet":
      ensure  => latest,
      release => lenny-backports;
}

Which of course, is intended to keep puppet up-to-date using the
packages released under "lenny-backports" in the backports repo (which
of course would have already been set up in sources.list)

I really, really want to do this as a plugin, and not modify puppet's
code directly, since that's just taking the road to crazy-town when it
comes to system admin, which is why I'm learning puppet in the first
place!

I've attempted the following, all with no success:
  1. write a plugin that attempts to add the "release" property to
Puppet::Type.type(:package) (Puppet::Type::Package?)
  2. write a plugin that creates a type called "my_package" that
subclasses Puppet::Type.type(:package), and then a provider to use
that.
  3. Copy the package.rb and apt.rb source files into the plugin
directories and modify them with new names (my_package,my_apt)  and
add the new desired functionality...

So far, none of this has worked. I'm a total ruby newbie, but quite
experienced in other dynamic languages. However, trying to follow
what's going on between type.rb and metatype/manager.rb et al it's
clear that I'm going to need a lot more knowledge of ruby's semantics
to do this via options 1 or 2... and I'm totally stumped as to why 3
does not work.

An example error message from running 'puppet --verbose --debug --
noop' on a manifest that uses the new type...

  Parameter ensure failed: Validate method failed for class ensure:
undefined method `satisfies?' for nil:NilClass

It's clear there is way more magick happening here than meets the
untrained eye. (Not a criticism - I'm primarily a perl hacker :)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to