Installing hiera

602 views
Skip to first unread message

llo...@oreillyauto.com

unread,
Jun 22, 2012, 3:25:49 PM6/22/12
to puppet...@googlegroups.com
My puppet master is behind a proxy and unable to connect to a gem repo, so I used a different machine to fetch hiera and hiera-puppet gems, and the hiera-puppet source tarball.

I then did a gem install on them, and I made sure that hiera was in the path, and extracted the hiera-puppet sources into my modulepath.

I ran puppet agent on the master (as suggested by a comment on http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ ) and I also did a service puppetmaster restart.

I set up a basic hierarchy, with just a common layer for right now, and I added some variables to it.

When I do a puppet run, I get the following error:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: no such file to load -- hiera

Did I miss a step, or am I doing something wrong?

I am using puppet 2.7.14 on Lucid for my puppet master, and the agent in question is running 2.7.16 on Precise.

My hiera.yaml is:
---
:hierarchy:
  - common
:backends:
  - yaml
:yaml:
  :datadir: '/etc/puppet/environments/%{environment}/hieradata'

Denmat

unread,
Jun 22, 2012, 6:23:49 PM6/22/12
to puppet...@googlegroups.com
Hi,

Try opening irb and seeing if you can require hiera.

$ irb
require 'rubygems'
require 'hiera'

(should return true)

Then at least you'll know if your gem is installed properly.

Den
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/fq1TjFDBu9QJ.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Kelsey Hightower

unread,
Jun 25, 2012, 9:37:30 AM6/25/12
to puppet...@googlegroups.com
Did you ever get this working? 

llo...@oreillyauto.com

unread,
Jun 25, 2012, 10:58:41 AM6/25/12
to puppet...@googlegroups.com


On Monday, June 25, 2012 8:37:30 AM UTC-5, Kelsey Hightower wrote:

Did you ever get this working? 

No, I still do not have this working.

Dan - When I did the irb thing, I got "true" for both requires.

Also, I can do lookups successfully on CLI, just not from puppet.

llo...@oreillyauto.com

unread,
Jun 25, 2012, 11:15:42 AM6/25/12
to puppet...@googlegroups.com
On a related note, I saw a post where someone had a similar problem, but they fixed it by adding/creating some "missing default file" - but they did not elaborate.

Any ideas on what that may be, so I can check it out?

Florian Koch

unread,
Jun 25, 2012, 11:21:20 AM6/25/12
to puppet...@googlegroups.com
Hi,
Have you the hiera Files in the puppet libdir e.g /var/lib/puppet/lib ?

Regards




Am 25.06.2012 um 17:15 schrieb "llo...@oreillyauto.com" <llo...@oreillyauto.com>:

On a related note, I saw a post where someone had a similar problem, but they fixed it by adding/creating some "missing default file" - but they did not elaborate.

Any ideas on what that may be, so I can check it out?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/eUxkzp8_4qIJ.

llo...@oreillyauto.com

unread,
Jun 25, 2012, 11:34:47 AM6/25/12
to puppet...@googlegroups.com


On Monday, June 25, 2012 10:21:20 AM UTC-5, Florian Koch wrote:
Hi,
Have you the hiera Files in the puppet libdir e.g /var/lib/puppet/lib ?


No, I do not, actually.

Which files need to go there? The stuff in /var/lib/gems/1.8/gems/hiera-0.3.0/lib/ ?

Florian Koch

unread,
Jun 25, 2012, 1:30:13 PM6/25/12
to puppet...@googlegroups.com
this is my /var/lib/puppet/lib


[root@foreman-proxya01 lib]# tree
.
├── hiera
│   ├── backend
│   │   └── puppet_backend.rb
│   └── scope.rb
└── puppet
    └── parser
        └── functions
            ├── foreman.rb
            ├── hiera_array.rb
            ├── hiera_hash.rb
            ├── hiera_include.rb
            └── hiera.rb


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Vd1FW3XHlOoJ.

Nan Liu

unread,
Jun 25, 2012, 2:16:20 PM6/25/12
to puppet...@googlegroups.com
On Mon, Jun 25, 2012 at 10:30 AM, Florian Koch
<florian....@googlemail.com> wrote:
> this is my /var/lib/puppet/lib
>
>
> [root@foreman-proxya01 lib]# tree
> .
> ├── hiera
> │   ├── backend
> │   │   └── puppet_backend.rb
> │   └── scope.rb
> └── puppet
>     └── parser
>         └── functions
>             ├── foreman.rb
>             ├── hiera_array.rb
>             ├── hiera_hash.rb
>             ├── hiera_include.rb
>             └── hiera.rb

This directory is typically managed by pluginsync, so in most cases do
not directly copy files in this directory, but rather make sure you
have the right modules on the puppet master. The modules that provide
these functions are: http://www.github.com/puppetlabs/hiera-puppet, so
make sure you have this module in the puppet master module path, and
run puppet agent -t --pluginsync.

Thanks,

Nan

harveyzh

unread,
Jul 8, 2012, 12:29:37 PM7/8/12
to Puppet Users
hello!

On Jun 25, 11:34 pm, "llow...@oreillyauto.com"
Did you execute the following command in the puppet modulepath
directory ?

curl -L https://github.com/puppetlabs/hiera-puppet/tarball/master -o \
'hiera-puppet.tar.gz' && mkdir hiera-puppet && tar -xzf hiera-
puppet.tar.gz \
-C hiera-puppet --strip-components 1 && rm hiera-puppet.tar.gz

The master branch of hiera-puppet repo seems different from hiera-
puppet gem.

# gem list|grep hiera-puppet
hiera-puppet (0.3.0)

Try to use hiera-puppet gem:
1. Change to the modulepath directory.
2. Backup hiera-puppet master branch version.
3. Copy hiera-puppet gem version:
cp -a /usr/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0/ hiera-puppet

llo...@oreillyauto.com

unread,
Jul 9, 2012, 9:18:06 AM7/9/12
to puppet...@googlegroups.com
I was able to get this working thanks to the the Puppet IRC channel, and specifically Kelsey Hightower.

The gem didn't install things quite well enough for Puppet, and when I ran the recommended command to get the sources in place for pluginsync, I grabbed a newer version that just happened to have some other issues in it.

But I do have things working now.
Reply all
Reply to author
Forward
0 new messages