Puppet Master can't load custom types?

asked 2015-09-18 15:38:58 -0500

syphrix gravatar image

I'm attempting to use a custom type for OS X. I created a basic example on my local machine to test its basic functionality by doing the following:

$ puppet module install custom_type 
$ touch test.pp

My test file looks something like this

# test.pp
include custom_type

custom_type { 'custom thing':
  value => 'new'
}

Then I execute it with

$ puppet apply test.pp

And everything works as I expect.

But when I install the module on my Puppet master, add the code snippet to my node definition, and run puppet agent -t on my node, it fails. I get errors like Could not autoload puppet/type/custom_type: Could not autoload puppet/provider/custom_type/custom_provider: cannot load such file -- /opt/puppetlabs/puppet/cache/lib/puppet/custom_type_dependency

From a few things I've read, this may have something to do with Puppet not including a module's lib directory in the ruby load path. But I'm not sure how to generically resolve this, as it has happened with more than one custom type for me. I've even gone through the source of one of the custom types to change all of the require statements that refer to local files, to requiring the files relatively from the file's own path without any luck.

Any advice?

edit retag flag offensive close merge delete