I'm really digging hiera, but I have a problem that I just can't seem
to work out:
I am working on a puppet module, and I have two classes: puppet::agent
and puppet::master. The layout of the classes are very similar, but
hiera can only successfully find my variables in one of them.
$confdir/environments/development/
hieradata/
common.json
modules.json
modules/
puppet/
manifests/
init.pp
data.pp
agent.pp
master.pp
agent/
data.pp
master/
data.pp
nodes/
site.pp
agent.pp:
--------------
class puppet::agent(
$bindir = hiera('puppet_agent_bindir'),
$confdir = hiera('puppet_agent_confdir'),
$configfile = hiera('puppet_agent_configfile'),
...
) {
...
}
---------------------
agent/data.pp
-------------------
class puppet::agent::data {
$puppet_agent_bindir = '/usr/bin'
$puppet_agent_confdir = '/etc/puppet'
$puppet_agent_configfile = 'puppet.conf'
...
}
----------------
When I include puppet::agent, the manifest compiles fine, finds the
default values in agent/data.pp, and all is well. The master
configuration is the same:
master.pp
--------------
class puppet::master(
$confdir = hiera('puppet_master_confdir'),
$bindir = hiera('puppet_master_bindir'),
$configfile = hiera('puppet_master_configfile'),
...
) {
...
}
-----------------------
master/data.pp
----------------------
class puppet::master::data {
$puppet_master_confdir = '/etc/puppet'
$puppet_master_bindir = '/usr/bin'
$puppet_master_configfile = 'puppet.conf'
...
}
---------------------------
But when I include puppet::master, the catalog fails to compile,
because hiera cannot find the values:
-----------------
Could not find data item puppet_master_confdir in any Hiera data file
and no default supplied at
/etc/puppet/environments/development/modules/puppet/manifests/master.pp:71
on node foo.bar.org
-----------------
When generating the catalog for the agent, I see this in the puppet output:
-----------------
debug: hiera(): Hiera Puppet backend starting
debug: hiera(): Looking up puppet_agent_bindir in Puppet backend
debug: hiera(): Looking for data in data::nodes/foo
debug: importing
'/etc/puppet/environments/development/modules/puppet/manifests/agent/data.pp'
in environment development
debug: importing
'/etc/puppet/environments/development/modules/puppet/manifests/data.pp'
in environment development
debug: hiera(): Looking for data in data::modules-rh
debug: hiera(): Looking for data in data::modules
debug: hiera(): Looking for data in data::common
debug: hiera(): Looking for data in puppet::agent::data
debug: hiera(): Found data in class puppet::agent::data
------------------
The same section of output looks the same when compiling the master,
only the very last line is missing. Does that mean that the puppet
backend cannot parse the master/data.pp file? I've stared at it until
my eyes crossed, and I don't see anything wrong. I am going to
simplify my classes and see what I come up with, but I am pretty
baffled at this point.
Thanks for any help,
Chad
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en.