Properly handle edges between exported resources

This was previously failing when an edge referred to an exported
resource which was also collected, because it was incorrectly assuming
collected resources would always be marked as NOT exported. However, in
the case of a node collecting a resource which it also exports, the
resource is still marked exported. In that case, it can be distinguished
from a purely exported resource by whether it's virtual. Purely virtual,
non-exported resources never appear in the catalog.

Virtual, exported resources are not collected, whereas non-virtual,
exported resources are. The former will eventually be removed from the
catalog before being sent to the agent, and thus aren't eligible for
participation in a relationship. We now check whether the resource is
virtual rather than exported, for correct behavior.
Clarify virtual vs. exported in catalog terminus
(#16437) Additional database pool config options

* conn-max-age: How many minutes a database connection can be idle
  before we terminate the connection. We default to 60 minutes.

* conn-keep-alive: How often, in minutes, should we send a keep-alive
  query to the database. We default to every 240 minutes.

Both of these can be used to configure PuppetDB so that it doesn't run
afoul of things like idle connection termination on load balancers.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Refer to ticket numbers in comments about exported resources
Merge pull request #279 from nicklewis/handle-exported-resource-edges

Properly handle edges between exported resources
Merge branch '1.0.x'
Use the /v2/facts API in the facts terminus
Build PE puppetdb in cows

Currently building pe-puppetdb requires a build environment
with Puppet Enterprise installed, and offers no guarantee
of a clean build environment with appropriate dependency
resolution for the various debian PE distributions we
support. This commit modifies pe building to use cowbuilder
and pdebuild incantations for the supported pe debian
distributions.
Update CHANGELOG.md for 1.0.0 release
Port acceptance tests to use new puppetdb module.
Get rid of explicit "--storeconfig" arguments.

Since we're now using the puppetdb module to set things up for
the acceptance tests, and the module is correctly configuring
the storeconfigs in the puppet.conf file on the master, we
no longer need to explicitly pass these arguments on the
command line in our tests.
Merge pull request #286 from cprice-puppet/feature/master/use-puppetdb-module-in-acceptance

Feature/master/use puppetdb module in acceptance
add a gemfile to build puppetdb-terminus
Change to cprice404 namespace for puppetdb module

Looks like there might be one more small bug in the
puppetdb module.  I've fixed it and released it
to cprice404 namespace; changing the acceptance
tests to point to that so that we can test it out
before pushing it up to the puppetlabs namespace.
Disable redhat firewall management during acceptance

This commit changes the acceptance setup such that it
does *not* attempt to manage redhat firewalls during
tests.  This seems necessary because our current
centos5 jenkins VMs have a weird configuration where
iptables is installed but not running, and so the
firewall module fails when it tries to manage the
firewall.

Hopefully this commit will get the tests passing for now,
but the correct longer-term solution for this is to
make the firewall module more resilient and/or get our
jenkins nodes into a more normal state so that we can
re-enable this, because it would be useful for it to be
included in the tests.
Merge commit '1.0.0' into 1.0.x
Merge branch '1.0.x'
Fix acceptance tests to always install 'latest' puppetdb package.
DRY up manifest applications

Refactor some duplicated code, and log all
manifest snippets as they are applied
to help with debugging.
Add 'purge_after_run' setting for acceptance

This new setting allows us to flag whether or
not to remove packages and do other exhaustive
cleanup after a run.  The previous behavior
was to always do this, which was useful when
doing repeated runs of the acceptance tests on
a VM without restoring a snapshot of the VM
between runs.  This commit changes the default
behavior so that the packages are *not* removed
after a test run, which is more useful for
debugging the runs on CI; the original behavior
can still be achieved by defining the setting
via an environment variable, etc.