Mitchell Hashimoto
2012-Aug-14 19:13 UTC
[Puppet Users] Testing Hiera Lookup with Puppet Master
Hello, Is there an easy way to test hiera lookup for a node? A node is not getting the value I expect from Hiera and I want a way to test this. I noticed that `hiera` has an option called `-i` to use the Puppet inventory service. With the latest (RC4 I believe) of Hiera I''m getting the following when I try to use that though: Puppet inventory service lookup failed: NoMethodError: undefined method `parse'' for #<Puppet::Settings:0x7f912d23a558> Could not load Puppet inventory service scope: SystemExit: exit Therefore it is not working. Any other way? Best, Mitchell -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
R.I.Pienaar
2012-Aug-14 19:34 UTC
Re: [Puppet Users] Testing Hiera Lookup with Puppet Master
----- Original Message -----> From: "Mitchell Hashimoto" <mitchell.hashimoto@gmail.com> > To: puppet-users@googlegroups.com > Sent: Tuesday, August 14, 2012 12:13:19 PM > Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master > > Hello, > > > Is there an easy way to test hiera lookup for a node? A node is not > getting the value I expect from Hiera and I want a way to test this.It depends on what backends you use, the CLI cannot get access to the data inside the puppet backend for example but for JSON/YAML it shouldd work My install lags a bit in versions and I do not have the inventory service so its hard to say whats up with that, but given a /etc/hiera.yaml that points to the right hiera db dir for json files I can do: $ hiera key fact=val fact=val fact=val the key being what you want and the kv pairs being the scope it will pass through the hierarchy you can also set your master to debug logging and you''ll see it log every lookup and what its trying -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mitchell Hashimoto
2012-Aug-14 20:12 UTC
Re: [Puppet Users] Testing Hiera Lookup with Puppet Master
On Tuesday, August 14, 2012 12:34:45 PM UTC-7, R.I. Pienaar wrote:> > > > ----- Original Message ----- > > From: "Mitchell Hashimoto" <mitchell....@gmail.com <javascript:>> > > To: puppet...@googlegroups.com <javascript:> > > Sent: Tuesday, August 14, 2012 12:13:19 PM > > Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master > > > > Hello, > > > > > > Is there an easy way to test hiera lookup for a node? A node is not > > getting the value I expect from Hiera and I want a way to test this. > > It depends on what backends you use, the CLI cannot get access to the > data inside the puppet backend for example but for JSON/YAML it shouldd > work > > My install lags a bit in versions and I do not have the inventory > service so its hard to say whats up with that, but given a /etc/hiera.yaml > that points to the right hiera db dir for json files I can do: > > $ hiera key fact=val fact=val fact=val > > the key being what you want and the kv pairs being the scope it will > pass through the hierarchy > > you can also set your master to debug logging and you''ll see it log every > lookup and what its trying >Thanks, I think I''ll go with the debug logging route for now. Is there a way in the "puppet.conf" file to enable debug logging? Best, Mitchell -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/JD0RUZ8zq-sJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
R.I.Pienaar
2012-Aug-14 23:36 UTC
Re: [Puppet Users] Testing Hiera Lookup with Puppet Master
----- Original Message -----> From: "Mitchell Hashimoto" <mitchell.hashimoto@gmail.com> > To: puppet-users@googlegroups.com > Sent: Tuesday, August 14, 2012 1:12:31 PM > Subject: Re: [Puppet Users] Testing Hiera Lookup with Puppet Master > > > > On Tuesday, August 14, 2012 12:34:45 PM UTC-7, R.I. Pienaar wrote: > > > > ----- Original Message ----- > > From: "Mitchell Hashimoto" < mitchell....@gmail.com > > > To: puppet...@googlegroups.com > > Sent: Tuesday, August 14, 2012 12:13:19 PM > > Subject: [Puppet Users] Testing Hiera Lookup with Puppet Master > > > > Hello, > > > > > > Is there an easy way to test hiera lookup for a node? A node is not > > getting the value I expect from Hiera and I want a way to test > > this. > > It depends on what backends you use, the CLI cannot get access to the > data inside the puppet backend for example but for JSON/YAML it > shouldd > work > > My install lags a bit in versions and I do not have the inventory > service so its hard to say whats up with that, but given a > /etc/hiera.yaml > that points to the right hiera db dir for json files I can do: > > $ hiera key fact=val fact=val fact=val > > the key being what you want and the kv pairs being the scope it will > pass through the hierarchy > > you can also set your master to debug logging and you''ll see it log > every > lookup and what its trying > > > > Thanks, I think I''ll go with the debug logging route for now. Is > there a way in the "puppet.conf" file to enable debug logging?not actually sure off the top of my head but just adding --debug to the flags on the CLI or in rack should do it -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.