(#14691) num-resources shouldn't include GC-able things

num-resources currently includes resources that aren’t associated with any
node’s current catalog. This patch corrects the query so that it ignores any
resources associated solely with stale catalogs or deactivated nodes.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Population-wide metrics should ignore deactivated nodes

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Fix init script for EL based PE installations

Previously, we were grepping on username in the find_my_pid function of
the init script.  This was fine if the username was <= 8 characters, but
since pe-puppetdb is not, 'ps -ef' would fall back to using UID in the
processes table, thus causing the function to fail.  This in turn led to
empty pid files and puppetdb potentially starting lots of times.

We now grep the jarfile name rather than user to confine the process
listing.

Signed-off-by: Michael Stahnke <stahnma@puppetlabs.com>
Merge pull request #169 from stahnma/tickets/master/14736_rh_init_script_with_pe

Fix init script for EL based PE installations
Merge pull request #168 from grimradical/pop_queries_14691

(#14691) Population-wide metrics should ignore "stale" data
Make use of not= consistent

There are cases (in src/ and test/) where (not (= ..)) is used and (not=
..) is used. This change makes the uses consistent across the codebase.
Change SSL setup to use master SSL keys instead of agent.
Merge pull request #171 from KushalP/master

Make use of (not= ...) consistent
Allow introspection of version number

This patchset stores the auto-computed version number for PuppetDB:

* on-disk, inside of a generated JAR file
* in-memory, in `com.puppetlabs.puppetdb.cli.services/version`

This is done by modifying our build file slightly to add a custom metadata
field to build outputs, and adding a func that can parse that field back into
memory.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #170 from grimradical/version_stamp

Allow introspection of version number
Correct the description of payload.

The payload may contain any JSON content, with no restrictions on type.
Previously it indicated that it was a string, which was not accurate.
Minor corrections to the README
Merge pull request #175 from cprice-puppet/maint/master/minor-readme-changes

Minor corrections to the README
Sort unordered metaparameter values during catalog serialization

You have a resource with a metaparameter, `tag`, with a value of `["c", "b",
"a"]`. We generate a catalog and that catalog is sent to PuppetDB. The next
time Puppet runs, you get the same resource, with the same metaparameter `tag`,
only the value is now `["a", "b", "c"]`. That catalog is also sent to PuppetDB.

Everything works correctly, however PuppetDB will think that the second catalog
is different from the first catalog. That's okay in terms of correctness, but
it's slower...`tag` (and several other metaparameters) are inherently
unordered. We should treat both catalogs the same because, semantically, they
are.

This patchset munges catalogs prior to submission to PuppetDB such that all
inherently unordered metaparameters are sorted. That way the output is the same
no matter the initial ordering.

You may be wondering how it's possible that Puppet could generate 2 different
orders for the same metaparam. But imagine that you're using the spaceship
operator to set dependency relationships on resources. Puppet doesn't order the
results of a resource collection operation. Something like this, for example,
can trigger this bug:

   Yumrepo <| |> -> Package <| |>

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #174 from grimradical/sort-unordered-metaparams

Sort unordered metaparameter values during catalog serialization
Fix puppetdb.conf parser to accept hostnames

This regex was looking only for word characters, so servers like
foo.example.com wouldn't work because of the . characters. Obviously
this is an extremely common case, and absolutely needs to be supported.
Default port for puppetdb.conf should be 8081

In jetty.ini by default we set plaintext port to 8080 and ssl port to
8081. Because puppet must talk to puppetdb over ssl, it should also
default to talking to 8081.
Merge pull request #177 from nicklewis/fix-config-parsing

Fix puppetdb.conf parser to accept hostnames
Fix default port numbers in readme
Merge pull request #178 from cprice-puppet/maint/master/readme-port-nums

Fix default port numbers in readme