crayfishx / hiera-http

HTTP backend for Hiera

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: `rescue in block in load_backends': Cannot load backend http

dzeleski opened this issue · comments

Getting this error while trying to test out the http backend. I installed via puppetserver gem install hiera-http. Currently running PE 2016.1.1.

Below is a hiera test with debug output.

[root@plxlb-puppet puppet]# hiera httptest -d -c /etc/puppetlabs/puppet/hiera.yaml environment=lab
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/config.rb:78:in `rescue in block in load_backends': Cannot load backend http: cannot load such file -- hiera/backend/http_backend (RuntimeError)
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/config.rb:75:in `block in load_backends'
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/config.rb:74:in `each'
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/config.rb:74:in `load_backends'
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera.rb:47:in `initialize'
        from /usr/local/bin/hiera:232:in `new'
        from /usr/local/bin/hiera:232:in `<main>'

Below is my hiera.yaml file


---
:backends:
  - http
  - yaml

:logger: console
:merge_behavior: deeper
:deep_merge_options:
  :knockout_prefix: '--'

:hierarchy:
  - "nodes/%{clientcert}"
  - "products/%{product}/clients/%{client_id}/roles/%{role}"
  - "products/%{product}/clients/%{client_id}"
  - "products/%{product}/roles/%{role}/client_environments/%{client_environment.type}"
  - "products/%{product}/roles/%{role}"
  - "products/%{product}/common"
  - "common"

:yaml:
  :datadir: /etc/puppetlabs/code/environments/%{environment}/hieradata

# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/environments/%{environment}/hieradata on *nix
# - %CommonAppData%\PuppetLabs\code\environments\%{environment}\hieradata on Windows
# When specifying a datadir, make sure the directory exists.

:http:
  :host: 10.X.X.X
  :port: 8080
  :output: json
  :cache_timeout: 10
  :headers:
    :Authorization: Basic AAAAAAA
  :paths:
    - /hiera/common/common

Im using mongoDB with a restAPI in front of it. Im not exactly sure whats going on and would appreciate some assistance if possible.

@dzeleski "puppetserver gem install" will install hiera-http in the jRuby instance used by puppet server, Hiera on the CLI and puppet apply don't use jRuby, so you also need to install it in the MRI ruby instance that ships with PE... /opt/puppetlabs/puppet/bin/gem install hiera-http

Apologies on the extremely long delay. Got pulled off onto other things and just got back to this. I installed the gem using the MRI instance and it is now working. Thank you very much!