dalen / puppet-puppetdbquery

Query functions for PuppetDB
Apache License 2.0
197 stars 69 forks source link

Hiera puppetdb_backend could not be found #97

Open adfel70 opened 7 years ago

adfel70 commented 7 years ago

We used to work a lot with the puppetdb backend from Hiera on Puppet 3 and Hiera 1.3.4. No we are installing a new environment based on Puppet 4 (puppet 4.8, puppetserver 2.7.2, Puppetdb 4.3.0)

We installed version 2.2.0 of puppetdbquery module. the CLI is working, but when adding puppetdb backend into hiera.yaml file we are getting the following error on agents:

DataBinding 'hiera': Cannot load backend puppetdb: no such file to load -- hiera/backnd/puppetdb_backend

We tried to manually copy puppetdb_backend.rb to /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiea/backend but then we got the next error:

org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- puppetdb/connection

Surely we are missing something, so we stopped there... Could you please help us understand what we are doing wrong? Thanks!

fennnec commented 7 years ago

this is because of the split of library paths for server and agent. more details can be found here: https://tickets.puppetlabs.com/browse/SERVER-571

for use with the hiera CLI you also need to set the RUBYLIB environment variable like: RUBYLIB="/opt/puppetlabs/puppet/cache/lib" hiera

claflico commented 7 years ago

What module are you using to setup your puppetmaster? If using theforeman you'll want to set the following: puppet::server_ruby_load_paths:

This adds the line to the /etc/puppetlabs/puppetserver/conf/puppetserver.conf line otherwise you can manually add the line.