On Mon, Mar 10, 2014 at 6:30 AM, Rakesh Kathpal <rkath...@gmail.com> wrote:
> Hi, > > Its been some time that I have been working with puppet. > > I have recently installed puppetdb and am using puppetdb APIs to fetch the > data about facts etc.. > > > Few things that I have noticed are > > 1) Whenever I add a custom fact, I do not see it in the postgresql db > until I delete all the facts for the particular certname from db > (manually). So that in the next puppet run on the client, all facts will be > carried into the puppetdb. > > So is it the way, puppetdb is designed to work or am I missing something > here? > That is not the way it's designed to work, and I strongly recommend against direct manipulation of postgres (at the point you're messing with the db directly, your changes are outside of puppetdb's control...so caveat emptor). PuppetDB stores new facts for a node whenever a puppetmaster sends new facts to PuppetDB. That normally happens when you run puppet on the node itself...it runs facter, sends facts to the master, master sends a copy of those facts to puppetdb. You can verify that facts are going to puppetdb by looking at puppetdb.log; it should indicate that we've received a "replace facts" command for the node in question. You can also check the API directly. On your puppetdb node, curl http://localhost:8080/v3/nodes/foobar.com . That will dump out information about when we've last received data for that node. If it appears that puppetdb is getting updated facts for a node, but it doesn't include a custom fact, and forcibly clearing out the data results in that fact appearing, then I'd file a bug and include all of that information (including what version of puppetdb you're on). > > 2) Is there any way to know if a new node has started using puppet. I know > I can get a node list using the puppetdb API, but is there any way to know > amongst these nodes, which are new. > Or is there any other way to get newly added nodes in puppetdb / puppet?? > There's no mechanism currently in PuppetDB to get notified when a new node is added. PuppetDB tracks the timestamps of the latest data (catalogs, facts, reports) for each node, and that doesn't include the first time we ever got data for a node. If you can describe the desired API in more detail, this would make a good feature request. > > > > Appreciate any help on these queries. > > Thanks & Regards, > > Rakesh K. > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/CAEJrXMW7MvdaPTGcPjoZTJB4SkNGCy_wLcjpHNXwa%3D6hsTg5jQ%40mail.gmail.com<https://groups.google.com/d/msgid/puppet-users/CAEJrXMW7MvdaPTGcPjoZTJB4SkNGCy_wLcjpHNXwa%3D6hsTg5jQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAOjOXY19k5jQHtTtgb_zidSVeyJB6N5SVWdQWCajCKCM5jBQUg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.