puppet-puppetdbquery icon indicating copy to clipboard operation
puppet-puppetdbquery copied to clipboard

Hiera puppetdb_backend could not be found

Open adfel70 opened this issue 8 years ago • 2 comments

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!

adfel70 avatar Jan 10 '17 18:01 adfel70

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

fennnec avatar Jan 23 '17 12:01 fennnec

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

  • '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby'
  • '/opt/puppetlabs/puppet/cache/lib'

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

claflico avatar Jan 25 '17 05:01 claflico