By now, we have realized how comprehensive the amount of information stored on PuppetDB is, as it provides a complete view of all our nodes facts, catalogs, and reports. This is useful for a review of what happens on our infrastructure and for the metrics we can extract via queries on all the resources managed by Puppet, but that's not enough.
One of Puppet's limitations, the fact that a node basically has knowledge only about itself via its catalog, and can "interact" with other nodes only via exported resources, would be wiped out if it were possible to make all PuppetDB data at our disposal when compiling a catalog for a node.
Well, this is possible, and can be easily done via Eric Dalén's puppetdbquery
module.
Consider it the key that opens PuppetDB wonders to our Puppet code. It provides the following:
Command line tools (as a Puppet face)
Functions to query PuppetDB directly in our manifests
A Hiera backend.
This module enables PuppetDB integration to the next level...