Ask Your Question
1

hiera eyaml erroring out in puppet agent run [closed]

asked 2016-12-13 15:05:39 -0500

updated 2016-12-13 15:06:44 -0500

This is the error that i am getting when i do a sudo puppet agent -t on the agent node:

Error while evaluating a Function Call, Lookup of key 'epel::epel_mirrorlist' failed: DataBinding 'hiera': Cannot load backend eyaml: no such file to load -- hiera/backend/eyaml_backend

Hiera.yaml

# managed by puppet
---
:backends:
- eyaml
- consul
- yaml

:logger: console

:hierarchy:
  - secure
  - common

:eyaml:
  :datadir: /etc/puppetlabs/code/environments/%{::environment}/hieradata
  :pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
  :pkcs7_public_key: /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem

:consul:
  :host: 127.0.0.1
  :port: '8500'
  :paths:
  - /v1/catalog/service
  - /v1/catalog/node
 :yaml:
  :datadir: /etc/puppetlabs/code/environments/%{::environment}/hieradata

I have a secure.eyaml in /etc/puppetlabs/code/environments/%{::environment}/hieradata.

Please let me know if i should have hiera eyaml gem installed in puppet agent too? How to fix this error in the node side.

I have restarted the puppet server after the above mentioned hiera.yaml was generated.

I tried linking the folders as follows in the master

  sudo ln /opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml.rb /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/eyaml.rb

I am all out of options.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Redsmile
close date 2017-01-31 15:55:42.473269

Comments

did you install the eyaml gems using the `puppetserver gem` command? `puppetserver gem install hiera-eyaml`. If you installed it with system ruby instead of the puppetserver's AIO/JRuby, then that could be part of your problem. Try 'puppetserver gem list | grep eyaml'

DarylW gravatar imageDarylW ( 2016-12-13 15:42:29 -0500 )edit
1

The thing is I did not install the eyaml gems myself. In puppet/hiera module,it installed hiera eyaml gem.If i declared package{ 'hiera-eyaml':provider =>'puppet_gem'} in my manifest it gave me duplicate resource error.Please provide code for doing puppetserver gem install hiera-eyaml thru puppet.

Redsmile gravatar imageRedsmile ( 2016-12-13 16:01:59 -0500 )edit

I need to be able to do puppetserver gem install hiera-eyaml through puppet manifest. If i do it in the command line as per your advice, it works fine. I want to be able to do that via puppet manifest. Please provide example. Thanks!

Redsmile gravatar imageRedsmile ( 2016-12-13 16:02:47 -0500 )edit

Are you using a specific 'puppet' or 'hiera' module to install everything, or did you roll your own? If you are using a module from the forge, can you link to it?

DarylW gravatar imageDarylW ( 2016-12-14 07:38:43 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-12-14 10:47:42 -0500

DarylW gravatar image

Based on the comment thread above, I recommend using the puppet community (VoxPupuli) hiera module for configuring hiera, which can be found at https://forge.puppet.com/puppet/hiera

edit flag offensive delete link more

Comments

1

i used the voxpopuli hiera module's provider => puppetserver_gem and that did the magic.

Redsmile gravatar imageRedsmile ( 2016-12-14 11:34:21 -0500 )edit

I highly encourage using modules from voxpupuli... if there are any problems with the modules, there is a very helpful and friendly community that can help get your issues resolved!

DarylW gravatar imageDarylW ( 2016-12-14 12:32:29 -0500 )edit
1

answered 2016-12-14 07:23:03 -0500

LaurencelleJ gravatar image

updated 2016-12-14 12:31:16 -0500

DarylW gravatar image

I hit issues with the hiera module. In the manifest where I use it I had to install some symbolic links that were missing. I found this online and would like to give credit but that was a couple of months ago:

 file { '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/eyaml':
    ensure => link,
    target => '/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml',
    require => Package['hiera-eyaml'],
  }

  file { '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/eyaml_backend.rb':
    ensure => link,
    target => '/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml_backend.rb',
    require => Package['hiera-eyaml'],
  }

  file { '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/backend/eyaml.rb':
    ensure => link,
    target => '/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml.rb',
    require => Package['hiera-eyaml'],
  }

  file { '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/highline/':
    ensure => link,
    target => '/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/highline-1.6.21/lib/highline',
    require => Package['hiera-eyaml'],
  }

  file { '/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/highline.rb':
    ensure => link,
    target => '/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/highline-1.6.21/lib/highline.rb',
    require => Package['hiera-eyaml'],
  }

Also It couldn't find the eyaml executable so I defined it using the following hiera module cmdpath parameter in that class:

 cmdpath         => ['/opt/puppetlabs/puppet/bin', '/opt/puppetlabs/bin', '/usr/bin', '/usr/local/bin'],

Hope that helps.

edit flag offensive delete link more

Comments

Thank you for your response, Appreciate it!

Redsmile gravatar imageRedsmile ( 2016-12-14 15:20:52 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-13 15:05:39 -0500

Seen: 285 times

Last updated: Dec 14 '16