Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Enable remote PuppetDB collection in 2019.8.5+ #139

Merged
merged 6 commits into from
May 27, 2021

Conversation

jarretlavallee
Copy link
Contributor

@jarretlavallee jarretlavallee commented Apr 1, 2021

This PR enables remote PuppetDB collection by default when using PE 2019.8.5+. It does this by adding a new PuppetDB version fact and using that in a PuppetDB query for the PuppetDB nodes. The PR includes some clean up such as the following.

  • Consolidate all facts into a puppet_metrics_dashboard hash
  • Rename a function to better align with its current purpose

@jarretlavallee jarretlavallee requested a review from a team as a code owner April 1, 2021 17:51
Copy link
Contributor

@suckatrash suckatrash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the function puppet_metrics_dashboard::puppetdb_no_remote_metrics was removed but I don't see that a file for puppet_metrics_dashboard::puppetdb_v2_metrics was added?

@jarretlavallee
Copy link
Contributor Author

Good call. I just pushed up a commit with it in there.

@jarretlavallee
Copy link
Contributor Author

I was not expecting that failure. I can fix it by adding trusted_facts to https://github.com/puppetlabs/puppet_metrics_dashboard/blob/master/spec/classes/dashboards/telegraf_spec.rb#L9 but I am not sure how it was working before. I didn't intentionally change how the master_list is populated and don't see how it would have. Either way, it works on my machine and I will push a change to the spec to add the trusted_facts. Let me know if you see something I don't.

@jarretlavallee jarretlavallee force-pushed the client_auth branch 2 times, most recently from 30affb9 to eec9d7b Compare April 1, 2021 20:33
@jarretlavallee
Copy link
Contributor Author

Alright, that last commit should fix some of the last issues. Hopefully, the acceptance tests are green now.

@gavindidrichsen gavindidrichsen changed the base branch from master to main May 7, 2021 08:26
@MartyEwings MartyEwings added the enhancement New feature or request label May 25, 2021
Jarret Lavallee added 6 commits May 27, 2021 12:47
Prior to this commit, there was a fact that was not scoped. This commit
adds a puppetdb version fact and consolidates the dashboard overwrite
fact into the puppet_metrics_dashboard hash.
Prior to this commit, PuppetDB collection was restricted to localhost on
recent PuppetDB versions by default. It was possible to specify the
PuppetDB nodes manually, but the default parameters would not populate
based on specific PuppetDB versions. This commit updates the logic to
automatically collect data from PuppetDB versions that allow remote
collection.
Prior to this commit there was a function that did not align with its
function. puppetdb_no_remote_metrics was used to determine if the v1 or
v2 endpoints and dashboards were used. This commit renames the function
to better align with its current purpose.
Prior to this commit, there was a spec test failure due to an empty
array that should be populated by the trusted certname fact. This commit
adds that fact.
Prior to this commit, the puppetdb v2 logic was more complex than
needed. This update changes to anything over 5.5.19 to use v2, which
should fix the issues with some newer versions using v1 metrics.
Prior to this commit, the centos spec tests were not matching into with
the os name fact and being skipped. This commit fixes those spec tests
by adding Centos to the when case.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants