Add configuration options to filter facts out in OpenVoxDB termini - #502
Open
djuarezg wants to merge 1 commit into
Open
Add configuration options to filter facts out in OpenVoxDB termini#502djuarezg wants to merge 1 commit into
djuarezg wants to merge 1 commit into
Conversation
Support exact paths and regular expressions for top-level and structured facts. Rebuild nested values during filtering so the facts object owned by OpenVox is not modified. This overcomes the limitations of the server-side facts-blocklist setting. Signed-off-by: Daniel Juarez <daniel.juarez.gonzalez@cern.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add two
puppetdb.confsettings for excluding facts before they are submitted to OpenVoxDB:fact_names_blocklistmatches exact dot-separated fact paths.fact_names_blocklist_regexmatches complete fact paths using Ruby regular expressions.The filtering supports nested hashes and hashes inside arrays. It rebuilds structured values instead of modifying Puppet-owned facts in place.
Motivation
The existing server-side
facts-blocklistsetting cannot selectively remove keys from structured facts.This implements the behavior originally proposed in puppetlabs/puppetdb#4021, which is unlikely to be merged now that the upstream repository is inactive.
Example
This removes:
Invalid regular expressions are rejected when
puppetdb.confis loaded.We have been using at CERN this as a
patchfor quite some time already and it covers our use cases such as blocking podman interfaces polluting OpenvoxDB: