Skip to content

Add configuration options to filter facts out in OpenVoxDB termini - #502

Open
djuarezg wants to merge 1 commit into
OpenVoxProject:mainfrom
djuarezg:filter-structured-facts
Open

Add configuration options to filter facts out in OpenVoxDB termini#502
djuarezg wants to merge 1 commit into
OpenVoxProject:mainfrom
djuarezg:filter-structured-facts

Conversation

@djuarezg

@djuarezg djuarezg commented Aug 19, 2026

Copy link
Copy Markdown

Summary

Add two puppetdb.conf settings for excluding facts before they are submitted to OpenVoxDB:

  • fact_names_blocklist matches exact dot-separated fact paths.
  • fact_names_blocklist_regex matches 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-blocklist setting 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

[main]
fact_names_blocklist = secret, networking.interfaces.eth0.mac
fact_names_blocklist_regex = (^|\.)password$

This removes:

  • The complete top-level secret fact.
  • Only networking.interfaces.eth0.mac from the structured networking fact.
  • Any key named password, including keys inside hashes contained in arrays.

Invalid regular expressions are rejected when puppetdb.conf is loaded.

We have been using at CERN this as a patch for quite some time already and it covers our use cases such as blocking podman interfaces polluting OpenvoxDB:

cernpuppet::puppetdb::fact_names_blacklist_regex:
  - ^blockdevice_
  - ^db_
  # Migrating the filtering from https://github.com/cernops/facter/commit/6f7648b73dfe9fd35b9769eec0ac6053645d493a
  - ^networking.interfaces.*nic.*
  - ^networking.interfaces.*tap.*
  - ^networking.interfaces.veth.*

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>
@bastelfreak bastelfreak added the enhancement New feature or request label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants