We''re using the puppetlabs puppet rpms, on redhat 6. puppet server version: 3.1.1 I wanted to start using hiera for some databinding type purposes. I set up a /etc/puppet/hiera.yaml, pointing to a special hieradata directory...but clients were not seeing the values I populated. So I made a very stripped down version of a manifest for testing, with $domain=hiera("philcheck::value") file {"/tmp/hieratest": ensure => present, content=>"$domain \n", } The only way it found any hiera-set value, was if I put it in /var/lib/hiera/common.yaml Which is rather odd, because the autogenerated /etc/hiera.yaml does not mention "common". it mentions "global". And the config I created in /etc/puppet/hiera.yaml, I deliberately abused to reference "common-p", instead of "common". Yet it still pulls from "common". While ignoring any varient of /var/lib/hiera/${hostname}.yaml What''s going on and how can I fix this please? -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Keith Burdis
2013-Mar-27 20:12 UTC
Re: [Puppet Users] puppet 3 hiera configs hiding somewhere
Perhaps try: # ln -sf /etc/puppet/hiera.yaml /etc/hiera.yaml Also you can use the hiera command-line utility [1] to test - for example: # hiera --debug philcheck::value - Keith [1] http://docs.puppetlabs.com/hiera/1/command_line.html On 27 March 2013 18:29, Philip Brown <phil@bolthole.com> wrote:> We''re using the puppetlabs puppet rpms, on redhat 6. > puppet server version: 3.1.1 > > I wanted to start using hiera for some databinding type purposes. > I set up a /etc/puppet/hiera.yaml, pointing to a special hieradata > directory...but clients were not seeing the values I populated. > > So I made a very stripped down version of a manifest for testing, with > > $domain=hiera("philcheck::value") > > file {"/tmp/hieratest": > ensure => present, > content=>"$domain \n", > } > > > The only way it found any hiera-set value, was if I put it in > /var/lib/hiera/common.yaml > > Which is rather odd, because the autogenerated /etc/hiera.yaml does not > mention "common". it mentions "global". > And the config I created in /etc/puppet/hiera.yaml, I deliberately abused > to reference "common-p", instead of "common". > > Yet it still pulls from "common". While ignoring any varient of > /var/lib/hiera/${hostname}.yaml > > What''s going on and how can I fix this please? > > -- > 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?hl=en. > 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nick Fagerlund
2013-Mar-27 21:10 UTC
[Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On Wednesday, March 27, 2013 11:29:30 AM UTC-7, Philip Brown wrote:> > > I set up a /etc/puppet/hiera.yaml, pointing to a special hieradata > directory...but clients were not seeing the values I populated. >First off, check Puppet''s hiera_config setting (http://docs.puppetlabs.com/references/3.1.1/configuration.html#hieraconfig) -- is there a value in your puppet.conf? What happens if you explicitly point it at your hiera.yaml file? Next, double-check the syntax of your hiera.yaml file. (http://docs.puppetlabs.com/hiera/1/configuring.html) Are you forgetting the leading colon on :hierarchy:?> > The only way it found any hiera-set value, was if I put it in > /var/lib/hiera/common.yaml > > Which is rather odd, because the autogenerated /etc/hiera.yaml does not > mention "common". it mentions "global". >"Common" is in the default settings Hiera uses if the config file is empty or is missing keys. http://docs.puppetlabs.com/hiera/1/configuring.html#default-config-values Since "global" isn''t being used, that proves that Hiera isn''t reading /etc/hiera.yaml. Either the hiera_config setting is pointing it somewhere unexpected, or the format of your hiera.yaml is off, and it''s interpreting that config as missing a :hierarchy: setting. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Philip Brown
2013-Mar-28 01:22 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On Wed, Mar 27, 2013 at 2:10 PM, Nick Fagerlund <nick.fagerlund@puppetlabs.com> wrote:> First off, check Puppet''s hiera_config setting > (http://docs.puppetlabs.com/references/3.1.1/configuration.html#hieraconfig) > -- is there a value in your puppet.conf?nope, nothing. I tried your suggestion of explicitly setting it. It gets ignored. Would be real nice if there was some way to strace the puppetmaster demon doing its thing for a client!> Next, double-check the syntax of your hiera.yaml file. > (http://docs.puppetlabs.com/hiera/1/configuring.html) Are you forgetting the > leading colon on :hierarchy:?Here it is -- # # Apparently, this file is NOT CHECKED # --- :backends: - yaml :yaml: :datadir: /etc/puppet/hieradata :hierarchy: - %{hostname} #### to keith''s suggestion, of>Also you can use the hiera command-line utility [1] to test - for example: >> # hiera --debug philcheck::value That doesnt quite work as-is, eh? Because I need to know how to set the client hostname, Plus it''s not pulling in whatever puppet is setting it to. It''s pulling from /etc/yaml.conf if I call it that way. If I call it with -c /etc/puppet/hiera.yaml, it passes the syntax check. and even loads the value I expect. So it''s not a matter of a syntax error making the thing default, either. sigh... -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nick Fagerlund
2013-Mar-28 05:25 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On Wednesday, March 27, 2013 6:22:05 PM UTC-7, Philip Brown wrote:> > > > nope, nothing. > I tried your suggestion of explicitly setting it. > It gets ignored. >Weird. I''m out of ideas at this point.> Would be real nice if there was some way to strace the puppetmaster > demon doing its thing for a client! >You might try: - stop the puppet master service - in a console, run puppet master --no-daemonize --verbose --debug That will let you see everything in real time, with extra debug logging turned on. It might get you somewhere. You''ll need to reduce the agent load coming at it (or work on a set of dev systems), of course. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nick Fagerlund
2013-Mar-28 05:27 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On Wednesday, March 27, 2013 6:22:05 PM UTC-7, Philip Brown wrote:> > > nope, nothing. > I tried your suggestion of explicitly setting it. > It gets ignored. > >Oh wait, I just had another idea. File ownership/permissions? If you wrote it as root and it''s only accessible to root, puppet master will have a problem, since it drops permissions to the puppet user once it gets started. -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Keith Burdis
2013-Mar-28 07:21 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
Yes, perhaps try: # chown -R puppet:puppet /etc/puppet /var/lib/puppet - Keith On 28 Mar 2013 05:27, "Nick Fagerlund" <nick.fagerlund@puppetlabs.com> wrote:> > > On Wednesday, March 27, 2013 6:22:05 PM UTC-7, Philip Brown wrote: >> >> >> nope, nothing. >> I tried your suggestion of explicitly setting it. >> It gets ignored. >> >> > Oh wait, I just had another idea. File ownership/permissions? If you wrote > it as root and it''s only accessible to root, puppet master will have a > problem, since it drops permissions to the puppet user once it gets > started. > > -- > 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?hl=en. > 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Keith Burdis
2013-Mar-28 07:42 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On 28 Mar 2013 01:22, "Philip Brown" <phil@bolthole.com> wrote:> > On Wed, Mar 27, 2013 at 2:10 PM, Nick Fagerlund > <nick.fagerlund@puppetlabs.com> wrote:...> to keith''s suggestion, of > > >Also you can use the hiera command-line utility [1] to test - forexample:> > > > # hiera --debug philcheck::value > > That doesnt quite work as-is, eh? > Because I need to know how to set the client hostname,You could use: # hiera --debug philcheck:value hostname=$(facter hostname) - Keith -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Philip Brown
2013-Mar-28 21:53 UTC
Re: [Puppet Users] Re: puppet 3 hiera configs hiding somewhere
On Thu, Mar 28, 2013 at 12:42 AM, Keith Burdis <keith@burdis.org> wrote:> >> That doesnt quite work as-is, eh? >> Because I need to know how to set the client hostname, > > You could use: > > # hiera --debug philcheck:value hostname=$(facter hostname) >Thank you! That, along with -c /etc/puppet/hiera.yaml, helped debug some syntax errors. but that was not the problem. THE PROBLEM was... puppetmaster was started with /etc/puppet/hiera.yaml not existing. Apparently, it only reads it at startup. So, as soon as I restarted it "for debug purposes"... it started working as I expected it to. Lol? Thanks to everyone for all the suggestions -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.