Page MenuHomePhabricator

Cumin PuppetDB backend: allow to filter by last run metadata
Open, Needs TriagePublic

Description

The PuppetDB backend of Cumin doesn't allow to perform a more fine-tuned selection based on the nodes endpoint metadata [1].
In particular it could be useful to select based on:

  • certname using the regex operator that will enable more fine-tuning selections that are not available through the direct node matching
  • latest_report_status most likely in combination with report_timestamp to select hosts that had the last puppet run failed for example, simplifying what we currently do with [2]

As a first thought I think that a syntax of N:key OP value where OP is one of the valid PuppetDB API operators (the usual =, >, ...) should allow all those queries. N standing for nodes.

It would be nice if for the datetime fields the user could use some easy syntax like -30m to specify
the ISO-8601 format date of now() - 30 minutes.

[1] https://puppet.com/docs/puppetdb/4.4/api/query/v4/nodes.html#query-fields
[2] https://wikitech.wikimedia.org/wiki/Cumin#Run_Puppet_only_if_last_run_failed