Hi,
I have a simple hiera data file:
# /etc/puppet/hiera/defaults.yaml
---
test:
message: This message brought to you by hiera
I run `sudo hiera test` and get:
{"message"=>"This message brought to you by hiera"}
I then create a test class:
# test.pp
class test ($message) {
notify {"Param is: ${message}":}
}
include test
And try to apply the manifest `sudo puppet apply -d test.pp`, but I get
back the following err:
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up test::message in YAML backend
Debug: hiera(): Looking for data source defaults
Debug: hiera(): Looking up test::message in YAML backend
Debug: hiera(): Looking for data source defaults
Error: Could not find data item test::message in any Hiera data file and no
default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.bar
Error: Could not find data item test::message in any Hiera data file and no
default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.bar
When I try `sudo hiera test::message`, sure enough, it returns nil.
Can anybody tell me what I am missing?
Thanks,
--
Brian
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
What is in your /etc/puppet/hiera.yaml configuration file ?
“Sometimes I think the surest sign that intelligent life exists elsewhere in the
universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)
----- Original Message -----
From: "Brian Warsing" <dayglojesus@gmail.com>
To: puppet-users@googlegroups.com
Sent: Friday, July 12, 2013 3:04:36 PM
Subject: [Puppet Users] Hiera Dummy Question
Hi,
I have a simple hiera data file:
# /etc/puppet/hiera/defaults.yaml
---
test:
message: This message brought to you by hiera
I run `sudo hiera test` and get:
{"message"=>"This message brought to you by hiera"}
I then create a test class:
# test.pp
class test ($message) {
notify {"Param is: ${message}":}
}
include test
And try to apply the manifest `sudo puppet apply -d test.pp`, but I get back the
following err:
Debug: hiera(): Hiera YAML backend starting
Debug: hiera(): Looking up test::message in YAML backend
Debug: hiera(): Looking for data source defaults
Debug: hiera(): Looking up test::message in YAML backend
Debug: hiera(): Looking for data source defaults
Error: Could not find data item test::message in any Hiera data file and no
default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.bar
Error: Could not find data item test::message in any Hiera data file and no
default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.bar
When I try `sudo hiera test::message`, sure enough, it returns nil.
Can anybody tell me what I am missing?
Thanks,
--
Brian
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users .
For more options, visit https://groups.google.com/groups/opt_out .
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
On Friday, July 12, 2013 2:04:36 PM UTC-5, Brian Warsing wrote: This:> Error: Could not find data item test::message in any Hiera data file and > no default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.barTells you exactly what the problem is. Puppet is trying to look up a value for the parameter by the parameter''s fully-qualified (but non-absolute) name, "test::message". Your data instead contain a key "test", whose corresponding value happens to be a hash that has "message" among its own keys. That''s not the same thing at all. To provide a value intended for automatic binding to your class parameter, your data should look like this: --- test::message: This message brought to you by hiera John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.
Thanks, I knew it was something silly. On Friday, 12 July 2013 14:23:03 UTC-7, jcbollinger wrote:> > > > On Friday, July 12, 2013 2:04:36 PM UTC-5, Brian Warsing wrote: > This: > >> Error: Could not find data item test::message in any Hiera data file and >> no default supplied at /etc/puppet/manifests/test.pp:17 on node node.foo.bar > > > Tells you exactly what the problem is. Puppet is trying to look up a > value for the parameter by the parameter''s fully-qualified (but > non-absolute) name, "test::message". Your data instead contain a key > "test", whose corresponding value happens to be a hash that has "message" > among its own keys. That''s not the same thing at all. To provide a value > intended for automatic binding to your class parameter, your data should > look like this: > > --- > test::message: This message brought to you by hiera > > > John > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.