From 49c161b1d71bc0469ba0271df907d5d78e440741 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 19 Nov 2024 19:32:04 +0100 Subject: [PATCH] Add more PQL query examples --- _docs/pql_queries.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/_docs/pql_queries.md b/_docs/pql_queries.md index dbe373d..35d9961 100644 --- a/_docs/pql_queries.md +++ b/_docs/pql_queries.md @@ -282,6 +282,27 @@ Result: ``` +### Get value for fact A that have a specific value on fact b + +This returns the ip address for all nodes where the trusted fact `pp_role` is `foobar` + +```shell +puppet query 'inventory[certname,facts.networking.ip]{ trusted.extensions.pp_role = "foobar"}' +``` + +```json +[ + { + "certname": "bastel.local", + "facts.networking.ip": "127.0.0.1" + }, + { + "certname": "freak.local", + "facts.networking.ip": "127.0.0.2" + } +] +``` + ### Get all values for a structured fact The facts endpoint doesn't support structured facts :(