waveclaw / puppet-subscription_manager

Handle Client Registration to RedHat Satellite 6 or Katello
https://rhn.redhat.com
Other
6 stars 34 forks source link

resource types in this module fail on puppetserver 2.x #30

Closed pkranenburg closed 8 years ago

pkranenburg commented 8 years ago

The error encountered is this:

Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource      Statement, Could not autoload puppet/type/rhsm_repo: Could not autoload puppet/provider/rhsm_repo/subscription_manager: no such file to load -- puppet/type/rhsm_repo

This is not totally unexpected; puppetserver's ruby load path does not get set up to find all ruby code implementing custom types within puppet modules. See issue SERVER-94 among others. Note that the error may go away on subsequent puppet runs within the same ruby process as it caches ruby code. I found that the "require 'puppet/type/rhsm_*'" statement in the various providers is not actually required, since the provider code in there only needs access to the puppet type class methid to register a provider with a given type (which is passed by name) and not need to access the actual definitions of the type it provides for.

There's a pull request out that does just that; the patches are tested on puppetmaster/passenger v3.8 and puppetserver/jruby 2.4