FWIW I've submitted this patch today to:

- include the gem inside the manifest
- load the correct loadpaths
- enable relocatable hiera_configdir and hiera_yaml_datasource

https://github.com/puppetlabs/hiera-puppet/pull/20

This makes it much easier to have things configured until all the hiera is part of Telly.


On 04/04/12 18:17, Nan Liu wrote:
On Wed, Apr 4, 2012 at 9:10 AM, Martin Willemsma<mwillem...@gmail.com>  wrote:
Hi Andreas,

In my believe that message is from your puppetmaster unable to compile
the manifest because the hiera function is not present on the master.
If you install hiera gem, the functions are not copied to your puppet
functions dir.
That's correct. Per https://github.com/puppetlabs/hiera-puppet:

"For the moment the Gem install will place the Puppet Parser Function
where Puppet cannot find it, you should copy it out and distribute it
to your master using Pluginsync or something similar"

I would recommend checking your gem path on the puppetmaster and
confirm the files are present.

gem env
...
  - GEM PATHS:
     - /usr/lib/ruby/gems/1.8
     - /root/.gem/ruby/1.8
...


ls  /usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions/*hier*

Should list: -

/usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions/hiera_array.rb
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions/hiera_include.rb
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions/hiera_hash.rb
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions/hiera.rb

On my setup I was able to fix this my manually copying the file to the
puppet libdir:

# copy libs from hiera to puppet
cp /usr/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0/lib/puppet/parser/functions/*
/usr/lib/ruby/gems/1.8/gems/puppet-2.7.12/lib/puppet/parser/functions
However, I would recommend using puppet module path and puppet
pluginsync rather than copying the files to puppet's gem path. If your
module path is /etc/puppet/modules, the following command should get
the function in a location where puppet can find and compile:

ln -s /usr/lib/ruby/gems/1.8/gems/hiera-puppet-0.3.0
/etc/puppet/modules/hiera-puppet

If you want to check out the lastest version of hiera:

git clone git://github.com/puppetlabs/hiera-puppet.git
/etc/puppet/modules/hiera-puppet

HTH,

Nan


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

Reply via email to