On 6 December 2012 14:08, Chad Huneycutt <chad.huneyc...@gmail.com> wrote:

> On Wed, Dec 5, 2012 at 9:29 PM, Peter Brown <rendhal...@gmail.com> wrote:
> > On 5 December 2012 21:10, Vaidas Jablonskis <jablons...@gmail.com>
> wrote:
> >> On Wednesday, 5 December 2012 02:10:00 UTC, Pete wrote:
> >>> On 4 December 2012 21:17, Vaidas Jablonskis <jablo...@gmail.com>
> wrote:
> >>>
> >>> One last question.
> >>> I use a node level variable to specify the location of a node.
> >>> I use this for setting variables specific to that location like
> different
> >>> puppet master ip and nagios ip for the office and such.
> >>> I want to use that variable in hiera for the same purpose.
> >>> I have this in my hiera.yaml file.
> >>>
> >>> ---
> >>> :hierachy:
> >>>   - %{::clientcert}
> >>>   - %{::environment}
> >>>   - %{location}
> >>>   - virtual_%{::is_virtual}
> >>>   - common
> >>> :backends: yaml
> >>> :yaml:
> >>>   :datadir: /etc/puppet/hieradata
> >>>
> >>> it gets data from the common.yaml file but is seems to not get anything
> >>> from any of the other files.
> >>> it's definitely using the datadir because thats where the common.yaml
> >>> file is as well as the rest of the data files.
> >>> Am I missing something?
> >>>
> >> When you specify variables in hiera.yaml configuration file, then they
> are
> >> facts, not actual Puppet variables. So in this case you have it wrong.
> >>
> >> Instead of %{::environment}, use %{environment}, because a fact is
> always
> >> going to be a top scope variable.
> >
> >
> > That doesn't seem to work either...
> > I tried putting in another entry called extra (no var just the name) and
> it
> > didn't get used either.
> > So it's like it's not using anything that isn't called common.yaml
> >
> > So my guess is it's not the variables it's something else.
> >
> > Anyone got any ideas?
> > Or some docs I can dredge through?
>
>
> hiera generates great traces if you enable it.  I *think* you enable
> debug on the master to turn it on, but there might be something else
> you have to do.  If all else fails, the code is actually pretty
> straight-forward...
>

Do you mean using the --debug flag on a puppet agent run?
I tried that and it didn't tell me anything useful.

I also switched to getting the vars with a hiera('class::variable') call
and all that told me was

Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Could not find data item nrpe::params::nagios_ips in any Hiera data file
and no default supplied at
/usr/local/puppet/environments/development/modules/nrpe/manifests/params.pp:10
on node test.example.com

It doesn't tell me which hiera data files it it searching either which
doesn't help at all.

If I move the variable into my common.yaml file it works perfectly.

I don't have the time to dredge through ruby code to find out whats going
on.
I still haven't learnt ruby so it would take me longer to work it out.



>
>
> --
> Chad M. Huneycutt
>
> --
> 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.
>
>

-- 
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