Issue #16856 has been updated by Stefan Goethals.

Hi,

I created patch files on a clone of git://github.com/ripienaar/puppet.git

git format-patch b22eb3c443d1161653f58c270dee1b5f88676c5f

-rw-r--r--   1 root root      12255 Dec 27 13:03 
0001-16856-Add-a-module-data-directory-and-hiera-backend-.patch
-rw-r--r--   1 root root       5876 Dec 27 13:03 
0002-16856-Add-a-module-data-directory-and-hiera-backend-.patch
-rw-r--r--   1 root root       1063 Dec 27 13:03 
0003-16856-Add-a-module-data-directory-and-hiera-backend-.patch

Applying them on the latest git clone of puppet with 
git am -3 /tmp/patches/*


then building the rpms.

The Hiera-in module and standard hiera lookups work as expected.
But the 'inherits' method now seems broken.

<pre>
class test (
  $testvar = 'blah',
  $ttt = $test::data::ttt,
) inherits ::test::data
{
  notify { "Test module -testvar- .... :${testvar}:": }
  notify { "Test module -  ttt  - .... :${ttt}:": }
}
</pre>

<pre>
class test::data {
  $ttt = '::test::data:ttt is a var with this as the val'
}
</pre>

This gives the following error

<pre>
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up test::testvar in YAML backend
Debug: hiera(): Looking for data source common
Debug: hiera(): Hiera Module Data backend starting
Debug: hiera(): Looking up test::testvar in Module Data backend
Debug: hiera(): Reading config from /etc/puppet/modules/test/data/hiera.yaml 
file
Debug: hiera(): Looking for data in source 
/etc/puppet/modules/test/data/hiera.yaml
Debug: hiera(): Looking for data in source 
/etc/puppet/modules/test/data/osfamily/RedHat.yaml
Debug: hiera(): Looking up test::ttt in YAML backend
Debug: hiera(): Looking for data source common
Debug: hiera(): Looking up test::ttt in Module Data backend
Debug: hiera(): Reading config from /etc/puppet/modules/test/data/hiera.yaml 
file
Debug: hiera(): Looking for data in source 
/etc/puppet/modules/test/data/hiera.yaml
Debug: hiera(): Looking for data in source 
/etc/puppet/modules/test/data/osfamily/RedHat.yaml
Debug: hiera(): Looking for data in source 
/etc/puppet/modules/test/data/common.yaml
Error: Could not find data item test::ttt in any Hiera data file and no default 
supplied at /etc/puppet/manifests/site.pp:2 on node pm3-h.lan.super-visions.com
Error: Could not find data item test::ttt in any Hiera data file and no default 
supplied at /etc/puppet/manifests/site.pp:2 on node pm3-h.lan.super-visions.com
Error: Could not find data item test::ttt in any Hiera data file and no default 
supplied at /etc/puppet/manifests/site.pp:2 on node pm3-h.lan.super-visions.com
Debug: Finishing transaction 69977590831240
</pre>


----------------------------------------
Feature #16856: puppet should support data in modules
https://projects.puppetlabs.com/issues/16856#change-79757

Author: R.I. Pienaar
Status: Needs More Information
Priority: Normal
Assignee: R.I. Pienaar
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/1217


At present there is a way to store data in modules using the puppet backend for 
hiera but it is optional and kind of broken.  The site hierarchy impacts how 
the puppet backend behaves which makes it impossible for module authors to 
supply data in their modules they can rely on

I propose a new hiera backend that loads a hierarchy of data from the 'data' 
directory in the module, this module must always be present in a puppet 
install.  This ability is key to the ability to create configurable forge 
modules that do not have hard coded values thanks to the puppet 3 hiera 
integration

reference the users list thread 
https://groups.google.com/d/topic/puppet-users/pvqzeyHkrY4/discussion


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
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-bugs?hl=en.

Reply via email to