This email is mostly for Kelsey Hightower's benefit, but by no means is 
exclusively for him.

On Ubuntu 12.04 (32bit, 'server'), after installing puppet 3 (rc3) hiera 1 
(rc4) and hiera-puppet (rc2, from source)

These are the steps I took to get hiera/hiera-puppet working:

---
mkdir –p 
/etc/puppet/modules/hiera-puppet/lib/{hiera/backend,puppet/parser/functions}

cp /usr/lib/ruby/1.8/hiera/scope.rb 
/etc/puppet/modules/hiera-puppet/lib/hiera/
cp /usr/lib/ruby/1.8/hiera/backend/puppet_backend.rb 
/etc/puppet/modules/hiera-puppet/lib/hiera/backend/

cp /usr/lib/ruby/1.8/puppet/parser/functions/hiera* 
/etc/puppet/modules/hiera-puppet/lib/puppet/parser/functions

wget -O /etc/puppet/modules/hiera-puppet/lib/hiera_puppet.rb 
https://github.com/puppetlabs/hiera-puppet/blob/1.0rc/lib/hiera_puppet.rb

---

At this point, explicit hiera calls will work:

$a_user = hiera('apache_username')

notice("The value is: ${a_user}")


and normal (non explicit hiera usage) parameterized classes IF (AND ONLY 
IF) you specify values for all params will work.

  # -- Basenode -- #
  class { 'basenode':
    is_puppet_master => true,
    apt_host         => 'repo.XXXXX.com'
  }

However, param classes with defaults and no (or some) values specified 
still fail:

  # -- Basenode -- #
  class { 'basenode':
    is_puppet_master => true,
  }


Debug: hiera(): Looking up apache_username in YAML backend
Debug: hiera(): Looking for data source common
Scope(Node[puppet3-test.oreillyauto.com]): The value is: www-data
Debug: importing 
'/etc/puppet/environments/test/modules/basenode/manifests/init.pp' in 
environment test
Debug: Automatically imported basenode from basenode into test
Debug: hiera(): Looking up basenode::apt_host in YAML backend
Debug: hiera(): Looking for data source common
Debug: hiera(): Hiera Puppet backend starting
Debug: hiera(): Looking up basenode::apt_host in Puppet backend
Error: Puppet::Parser::AST::Resource failed with error NoMethodError: 
undefined method `catalog' for #<Hash:0xb6a446e0> at 
/etc/puppet/environments/test/manifests/nodes/puppet_local_test.pp:17 on 
node puppet3-test.oreillyauto.com
Error: Puppet::Parser::AST::Resource failed with error NoMethodError: 
undefined method `catalog' for #<Hash:0xb6a446e0> at 
/etc/puppet/environments/test/manifests/nodes/puppet_local_test.pp:17 on 
node puppet3-test.oreillyauto.com
Error: Puppet::Parser::AST::Resource failed with error NoMethodError: 
undefined method `catalog' for #<Hash:0xb6a446e0> at 
/etc/puppet/environments/test/manifests/nodes/puppet_local_test.pp:17 on 
node puppet3-test.oreillyauto.com
Debug: Received report to process from puppet3-test.XXXXXX.com


However....

After one successful, partial run I now get the following error when trying 
to run puppet:

Error: Failed to apply catalog: Error 400 on SERVER: Could not retrieve 
facts for puppet3-test.XXXXX.com: Could not autoload 
puppet/indirector/facts/active_record: uninitialized constant ActiveRecord

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-dev/-/5AhvA_7YEv0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to