I''m not sure at all what''s going on here, but I''ve spent a lot of time reading over the puppet hiera docs and setting everything up, but when I run puppet agent it just seems to ignore the hiera setup completely. Both the puppet master and agent nodes have exactly the same versions of puppet and hiera (installed via the official puppet APT repository). I''ve laid out my hiera files like this: /etc/hiera/hiera.yaml, /etc/hiera/data/%{::environment}, have symlinked both /etc/puppet/hiera.yaml and /etc/hiera.yaml to /etc/hiera/hiera.yaml, and have tested the hiera setup using the command line utility. All seems good. However, when I run puppet on the agent node it doesn''t install any of the classes I''ve outlined in my hierarchy. I tried running the puppet master in debug mode to see if it was having problems locating the hiera config but it seems to locate it ok, eg. "Debug: /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]". At least, it doesn''t appear to display any errors related to hiera. I''m really at a loss here. Any ideas? Thanks, Guy -- 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 Wednesday, September 11, 2013 5:50:18 PM UTC-5, Guy Knights wrote:> > I''m not sure at all what''s going on here, but I''ve spent a lot of time > reading over the puppet hiera docs and setting everything up, but when I > run puppet agent it just seems to ignore the hiera setup completely. > > Both the puppet master and agent nodes have exactly the same versions of > puppet and hiera (installed via the official puppet APT repository). I''ve > laid out my hiera files like this: /etc/hiera/hiera.yaml, > /etc/hiera/data/%{::environment}, have symlinked both > /etc/puppet/hiera.yaml and /etc/hiera.yaml to /etc/hiera/hiera.yaml, and > have tested the hiera setup using the command line utility. All seems good. > >Puppet uses hiera only during catalog compilation, so agent nodes do not normally require it. Correspondingly, only hiera data residing on the master contribute to catalogs compiled by the master -- is that your problem?> However, when I run puppet on the agent node it doesn''t install any of the > classes I''ve outlined in my hierarchy. I tried running the puppet master in > debug mode to see if it was having problems locating the hiera config but > it seems to locate it ok, eg. "Debug: /File[/etc/puppet/hiera.yaml]: > Autorequiring File[/etc/puppet]". At least, it doesn''t appear to display > any errors related to hiera. > > I''m really at a loss here. Any ideas? > >Are you anywhere instructing Puppet to include the classes listed in your hiera data in the catalog? You haven''t really given us much to work with. Generally speaking, Puppet and hiera work. If they are not working for you, then the problem likely resides in the configuration, manifests, or data that you are feeding them. If you present a simple example that is failing for you, then we can probably help you sort it out. 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 for the reply John. Here''s my hiera.yaml file: --- :backends: - yaml :yaml: :datadir: "/etc/puppet/%{::environment}/hieradata" :hierarchy: - "nodes/%{::clientcert}" - "roles/%{::esg_role}" - common My puppet.conf file on the puppet master: [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet templatedir=$confdir/templates server=puppet.eastsidegamestudio.com privatekeydir = $ssldir/private_keys { group = service } hostprivkey = $privatekeydir/$certname.pem { mode = 640 } pluginsync=true [master] # These are needed when the puppetmaster is run by passenger # and can safely be removed if webrick is used. ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY dns_alt_names = puppet.eastsidegamestudio.com autosign = $confdir/autosign.conf { owner = service, group = service, mode = 664 } [production] manifest = /etc/puppet/production/manifests/site.pp modulepath = /etc/puppet/production/modules fileserverconfig = /etc/puppet/production/fileserver.conf templatedir = /etc/puppet/production/templates/ [staging] manifest = /etc/puppet/staging/manifests/site.pp modulepath = /etc/puppet/staging/modules fileserverconfig = /etc/puppet/staging/fileserver.conf templatedir = /etc/puppet/staging/templates/ [development] manifest = /etc/puppet/development/manifests/site.pp modulepath = /etc/puppet/development/modules fileserverconfig = /etc/puppet/development/fileserver.conf templatedir = /etc/puppet/development/templates/ And finally, the agent node''s puppet.conf: [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter templatedir=$confdir/templates server=puppet.eastsidegamestudio.com [master] # These are needed when the puppetmaster is run by passenger # and can safely be removed if webrick is used. ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY [agent] environment=development I tried runnning the puppet agent and specifying the environment on the command line but it didn''t make a difference.I also moved the environment directive in the agent conf file to the [main] section, but still no change. Running hiera from the command line with the same settings as the agent has, I get this: $ hiera -d classes ::environment=development ::esg_role=couchbase DEBUG: Thu Sep 12 17:45:31 +0000 2013: Hiera YAML backend starting DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking up classes in YAML backend DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking for data source roles/couchbase DEBUG: Thu Sep 12 17:45:31 +0000 2013: Found classes in roles/couchbase [{"couchbase"=>nil}] Testing for fact esg_role on the agent node: $ facter esg_role couchbase For the record, my puppet version is 3.2.4, hiera is 1.2.1. Hope this helps. Regards, Guy On Thu, Sep 12, 2013 at 10:02 AM, jcbollinger <John.Bollinger@stjude.org>wrote:> > > On Wednesday, September 11, 2013 5:50:18 PM UTC-5, Guy Knights wrote: >> >> I''m not sure at all what''s going on here, but I''ve spent a lot of time >> reading over the puppet hiera docs and setting everything up, but when I >> run puppet agent it just seems to ignore the hiera setup completely. >> >> Both the puppet master and agent nodes have exactly the same versions of >> puppet and hiera (installed via the official puppet APT repository). I''ve >> laid out my hiera files like this: /etc/hiera/hiera.yaml, >> /etc/hiera/data/%{::**environment}, have symlinked both >> /etc/puppet/hiera.yaml and /etc/hiera.yaml to /etc/hiera/hiera.yaml, and >> have tested the hiera setup using the command line utility. All seems good. >> >> > > Puppet uses hiera only during catalog compilation, so agent nodes do not > normally require it. Correspondingly, only hiera data residing on the > master contribute to catalogs compiled by the master -- is that your > problem? > > > >> However, when I run puppet on the agent node it doesn''t install any of >> the classes I''ve outlined in my hierarchy. I tried running the puppet >> master in debug mode to see if it was having problems locating the hiera >> config but it seems to locate it ok, eg. "Debug: >> /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]". At least, >> it doesn''t appear to display any errors related to hiera. >> >> I''m really at a loss here. Any ideas? >> >> > > Are you anywhere instructing Puppet to include the classes listed in your > hiera data in the catalog? > > You haven''t really given us much to work with. Generally speaking, Puppet > and hiera work. If they are not working for you, then the problem likely > resides in the configuration, manifests, or data that you are feeding > them. If you present a simple example that is failing for you, then we can > probably help you sort it out. > > > John > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Puppet Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/puppet-users/9kdUVvrsr18/unsubscribe. > To unsubscribe from this group and all its topics, 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. >-- Guy Knights Lead Systems Administrator <http://eastsidegamestudio.com> www.eastsidegamestudio.com guy@eastsidegamestudio.com <guy@eastsidegamestudio.com> -- 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.
Actually, one thing I''ve noticed while trying to troubleshoot this issue is that I can''t see any evidence that puppet agent is using the environment specified in its config file. If I run puppet agent with the --debug flag there is no mention of the environment whatsoever. Is there any way to get puppet agent to tell me what environment it''s using when it requests the catalogue from the master? Thanks, Guy On Thu, Sep 12, 2013 at 10:48 AM, Guy Knights <guy@eastsidegamestudio.com>wrote:> Thanks for the reply John. Here''s my hiera.yaml file: > > --- > :backends: > - yaml > :yaml: > :datadir: "/etc/puppet/%{::environment}/hieradata" > :hierarchy: > - "nodes/%{::clientcert}" > - "roles/%{::esg_role}" > - common > > My puppet.conf file on the puppet master: > > [main] > logdir=/var/log/puppet > vardir=/var/lib/puppet > ssldir=/var/lib/puppet/ssl > rundir=/var/run/puppet > templatedir=$confdir/templates > server=puppet.eastsidegamestudio.com > privatekeydir = $ssldir/private_keys { group = service } > hostprivkey = $privatekeydir/$certname.pem { mode = 640 } > pluginsync=true > > [master] > # These are needed when the puppetmaster is run by passenger > # and can safely be removed if webrick is used. > ssl_client_header = SSL_CLIENT_S_DN > ssl_client_verify_header = SSL_CLIENT_VERIFY > dns_alt_names = puppet.eastsidegamestudio.com > autosign = $confdir/autosign.conf { owner = service, group = service, mode > = 664 } > > [production] > manifest = /etc/puppet/production/manifests/site.pp > modulepath = /etc/puppet/production/modules > fileserverconfig = /etc/puppet/production/fileserver.conf > templatedir = /etc/puppet/production/templates/ > > [staging] > manifest = /etc/puppet/staging/manifests/site.pp > modulepath = /etc/puppet/staging/modules > fileserverconfig = /etc/puppet/staging/fileserver.conf > templatedir = /etc/puppet/staging/templates/ > > [development] > manifest = /etc/puppet/development/manifests/site.pp > modulepath = /etc/puppet/development/modules > fileserverconfig = /etc/puppet/development/fileserver.conf > templatedir = /etc/puppet/development/templates/ > > And finally, the agent node''s puppet.conf: > > [main] > logdir=/var/log/puppet > vardir=/var/lib/puppet > ssldir=/var/lib/puppet/ssl > rundir=/var/run/puppet > factpath=$vardir/lib/facter > templatedir=$confdir/templates > server=puppet.eastsidegamestudio.com > > [master] > # These are needed when the puppetmaster is run by passenger > # and can safely be removed if webrick is used. > ssl_client_header = SSL_CLIENT_S_DN > ssl_client_verify_header = SSL_CLIENT_VERIFY > > [agent] > environment=development > > I tried runnning the puppet agent and specifying the environment on the > command line but it didn''t make a difference.I also moved the environment > directive in the agent conf file to the [main] section, but still no change. > > Running hiera from the command line with the same settings as the agent > has, I get this: > > $ hiera -d classes ::environment=development ::esg_role=couchbase > DEBUG: Thu Sep 12 17:45:31 +0000 2013: Hiera YAML backend starting > DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking up classes in YAML backend > DEBUG: Thu Sep 12 17:45:31 +0000 2013: Looking for data source > roles/couchbase > DEBUG: Thu Sep 12 17:45:31 +0000 2013: Found classes in roles/couchbase > [{"couchbase"=>nil}] > > Testing for fact esg_role on the agent node: > > $ facter esg_role > couchbase > > For the record, my puppet version is 3.2.4, hiera is 1.2.1. > > Hope this helps. > > Regards, > Guy > > > On Thu, Sep 12, 2013 at 10:02 AM, jcbollinger <John.Bollinger@stjude.org>wrote: > >> >> >> On Wednesday, September 11, 2013 5:50:18 PM UTC-5, Guy Knights wrote: >>> >>> I''m not sure at all what''s going on here, but I''ve spent a lot of time >>> reading over the puppet hiera docs and setting everything up, but when I >>> run puppet agent it just seems to ignore the hiera setup completely. >>> >>> Both the puppet master and agent nodes have exactly the same versions of >>> puppet and hiera (installed via the official puppet APT repository). I''ve >>> laid out my hiera files like this: /etc/hiera/hiera.yaml, >>> /etc/hiera/data/%{::**environment}, have symlinked both >>> /etc/puppet/hiera.yaml and /etc/hiera.yaml to /etc/hiera/hiera.yaml, and >>> have tested the hiera setup using the command line utility. All seems good. >>> >>> >> >> Puppet uses hiera only during catalog compilation, so agent nodes do not >> normally require it. Correspondingly, only hiera data residing on the >> master contribute to catalogs compiled by the master -- is that your >> problem? >> >> >> >>> However, when I run puppet on the agent node it doesn''t install any of >>> the classes I''ve outlined in my hierarchy. I tried running the puppet >>> master in debug mode to see if it was having problems locating the hiera >>> config but it seems to locate it ok, eg. "Debug: >>> /File[/etc/puppet/hiera.yaml]: Autorequiring File[/etc/puppet]". At least, >>> it doesn''t appear to display any errors related to hiera. >>> >>> I''m really at a loss here. Any ideas? >>> >>> >> >> Are you anywhere instructing Puppet to include the classes listed in your >> hiera data in the catalog? >> >> You haven''t really given us much to work with. Generally speaking, >> Puppet and hiera work. If they are not working for you, then the problem >> likely resides in the configuration, manifests, or data that you are >> feeding them. If you present a simple example that is failing for you, >> then we can probably help you sort it out. >> >> >> John >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Puppet Users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/puppet-users/9kdUVvrsr18/unsubscribe. >> To unsubscribe from this group and all its topics, 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. >> > > > > -- > Guy Knights > Lead Systems Administrator > <http://eastsidegamestudio.com> > www.eastsidegamestudio.com > guy@eastsidegamestudio.com > > <guy@eastsidegamestudio.com> >-- Guy Knights Lead Systems Administrator <http://eastsidegamestudio.com> www.eastsidegamestudio.com guy@eastsidegamestudio.com <guy@eastsidegamestudio.com> -- 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 Thursday, September 12, 2013 1:07:12 PM UTC-5, Guy Knights wrote:> > Actually, one thing I''ve noticed while trying to troubleshoot this issue > is that I can''t see any evidence that puppet agent is using the environment > specified in its config file. If I run puppet agent with the --debug flag > there is no mention of the environment whatsoever. > > Is there any way to get puppet agent to tell me what environment it''s > using when it requests the catalogue from the master? > >Yes, call the notice() function to emit that information into the master''s log, or declare a Notify resource to emit it into the agent''s log. Example: notify { ''My environment'': message => "my environment is ${::environment}" } Put that at top level in your site.pp to ensure that it is declared for every node, no matter what. 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.
Guy, On Thursday, September 12, 2013 12:02:36 PM UTC-5, I wrote:> > [...] > Are you anywhere instructing Puppet to include the classes listed in your > hiera data in the catalog? > >If the answer is yes, then you did not include that information with the configs you posted. The needed declaration would normally appear in your site manifest for the selected environment, or perhaps in a file imported by the site manifest. For example, node ''mynode'' { include hiera(''classes'') } I have a growing suspicion that your problem is in that general area, as I don''t immediately see anything wrong with the configs you posted. 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.
Ahhhhh....it all becomes clear. I was confused because as I understood it, if I defined the classes in hiera then puppet would just apply them. I went back through the docs and found this: http://docs.puppetlabs.com/hiera/1/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude. I changed my site.pp to use hiera_include(''classes'') and now it seems to be working. Thanks for your help, apologies for the confusion. Regards, Guy On Fri, Sep 13, 2013 at 6:44 AM, jcbollinger <John.Bollinger@stjude.org>wrote:> Guy, > > On Thursday, September 12, 2013 12:02:36 PM UTC-5, I wrote: >> >> [...] >> >> Are you anywhere instructing Puppet to include the classes listed in your >> hiera data in the catalog? >> >> > > If the answer is yes, then you did not include that information with the > configs you posted. The needed declaration would normally appear in your > site manifest for the selected environment, or perhaps in a file imported > by the site manifest. For example, > > node ''mynode'' { > include hiera(''classes'') > } > > I have a growing suspicion that your problem is in that general area, as I > don''t immediately see anything wrong with the configs you posted. > > > > John > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Puppet Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/puppet-users/9kdUVvrsr18/unsubscribe. > To unsubscribe from this group and all its topics, 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. >-- Guy Knights Lead Systems Administrator <http://eastsidegamestudio.com> www.eastsidegamestudio.com guy@eastsidegamestudio.com <guy@eastsidegamestudio.com> -- 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.