Querying nested facts with puppetdb

153 views
Skip to first unread message

Tim Skirvin

unread,
Mar 22, 2023, 11:57:37 AM3/22/23
to puppet...@googlegroups.com
I've historically done a lot of puppetdb queries based on legacy
system facts that are going away in puppet 8, e.g.:

https://[server]:8081/pdb/query/v4/facts/lsbmajdistrelease/8

Is there a puppetdb endpoint or trick that I can use to do the
same thing in the new way, with say, os.release.major?

This seems like it will be an important part of retiring legacy,
non-nested facts.

- Tim Skirvin (tski...@fnal.gov)
--
Fermilab SCF-SSI - HPC Architect He, Him, His

austin...@puppet.com

unread,
Mar 22, 2023, 1:00:17 PM3/22/23
to Puppet Users
The Inventory endpoint supports querying based on dotted fact paths for both projected values and query filters.

A similar PQL query to what you describe would look like

inventory[certname, facts.os.release.major] {
  facts.os.release.major = "8"
Reply all
Reply to author
Forward
0 new messages