On Mon, Dec 3, 2012 at 7:45 PM, Conor <[email protected]> wrote:

> List,
>
> I'm using Puppet 2.7.19 and Hiera 1.0.0, working on a new Hiera backend,
> and seem to be stumped at a pretty basic step: installation.
>
> I've created my backend in a module, and that file is on the puppetmaster
> in /etc/puppet/modules/hiera-sidb/lib/hiera/backend/sidb_backend.rb.
>
> When watching the output from 'puppet master --no-daemonize -dov', I see:
>
>    notice: hiera(): Cannot load backend rest: no such file to load --
> hiera/backend/sidb_backend
>
> I noticed that yaml_backend.rb and puppet_backend.rb are both in
> /usr/lib/ruby/site_ruby/1.8/hiera/backend/, and if I copy/symlink
> sidb_backend.rb to that path, I get the backend functionality I'm looking
> for.
>
>
The issue that you are hitting is that puppet does not add the modules to
the ruby $LOAD_PATH, which is where ruby looks for code to load. The other
directory (/usr/lib/...) is one of the default locations in the $LOAD_PATH
and so that is why the backends are placed there.

At the moment you can't easily ship hiera backends in puppet modules
because of this limitation. What you'll need to do is after you've
installed the module add that module's lib directory to the RUBYLIB
environment variable so that ruby picks it up when running puppet.


> My question is really: why isn't sidb_backend.rb being copied into
> /usr/lib/ruby/site_ruby/1.8/hiera/backend by puppet -- and more
> fundamentally, why is puppet choosing that path?
>
> I've been looking for a M to RTF, but the best I've found is:
> https://github.com/puppetlabs/hiera/blob/master/README.md, but it doesn't
> have a lot of help for writing your own backend
>
>
I don't think there is too much documentation about how to write hiera
backends, and the issue that you hit with getting it to load is related to
an existing bug that we are working on:
https://projects.puppetlabs.com/issues/7316


> Appreciate any help you can provide,
>
> -Conor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to