The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
puppet executable does not load all ruby files from modulepath/MODULENAME/lib
|Assignee:||Dan Bode||% Done:|
|Affected Puppet version:||0.25.4||Branch:|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
I would like to package utility classes together with provider code.
features/aws.rb provider/ec2/ec2.rb type/ec2.rb util/ec2.rb
where util/ec2.rb is a module that I would like to mix-in to my provider.
require 'puppet/util/ec2' Puppet::Type.type(:ec2).provide(:ec2) do include Puppet::Util::Ec2 ...
util/ec2.rb is not found by puppet.
danbode$ puppet ec2.pp Could not autoload "/Users/danbode/git/modules/ec2/lib/puppet/provider/ec2/ec2.rb": no such file to load -- puppet/util/ec2
When I specify rubylib, then it works
danbode$ export RUBYLIB=/Users/danbode/git/modules/ec2/lib/ danbode$ puppet ec2.pp
#5 Updated by Anonymous over 3 years ago
- Status changed from Duplicate to Accepted
Un-marking this as a duplicate.
In Telly, since we support loading faces located in
modulepath/foomodule/lib/puppet/ and we do not support loading faces located in the pluginsync
lib directory, this ticket is no longer a duplicate.
#8 Updated by Anonymous over 3 years ago
- Status changed from Accepted to Needs More Information
- Assignee set to Dan Bode
Dan, is this still an issue? As described it is about providers being able to load utility code. Puppet 3 changed how files are pluginsynced in a manner that should allow this to work.
#9 Updated by Josh Cooper over 3 years ago
- Target version changed from 3.x to 3.1.0
To follow up on Andy’s comment, when running
puppet agent, the libdir will be in the $LOAD_PATH, so
Kernel.require will be able to load utility code (specified as a relative path) from your pluginsync'ed module. In the case of
puppet apply (and everything else, but master), the environment-specific modulepath will be added to the $LOAD_PATH, so again you should be able to load utility code. Most likely we can close this as a dup of #7316.
#10 Updated by Josh Cooper over 3 years ago
- Status changed from Needs More Information to Duplicate
Verified with Dan that running
puppet apply with a module whose provider loads utility code is working as expected now that #7316 is fixed (the modulepath is added to $LOAD_PATH).
There could still be issues if the master loads a type and the type requires utility code. That part is #12173 and requires changes to the master to support loading code from multiple environments into the same ruby runtime.