Hello,

   I'm new to using PQL and i'm having a bit of difficulty.   I'm trying to 
return the ipaddress of any node where the value of three trusted facts 
(pp_application, pp_role and pp_environment) meets some criteria.

I have a query which will return only the nodes that i care about,  but I'm 
having a problem structuring the query to also return the top level 
ipaddress fact with the results.  Any help would be appreciated.  Thank 
you. 

$test_query = '["from", "facts",
                 ["and",
                   ["subquery", "fact_contents",
                   ["and",
                     ["~>", "path", ["trusted", "extensions", 
"pp_application"]],
                     ["=", "value", "someapp"]]],
                   ["subquery", "fact_contents",
                   ["and",
                     ["~>", "path", ["trusted", "extensions", "pp_role"]],
                     ["=", "value", "appserver"]]],
                   ["subquery", "fact_contents",
                   ["and",
                     ["~>", "path", ["trusted", "extensions", 
"pp_environment"]],
                     ["=", "value", "development"]]]]]]'

$test_results = puppetdb_query($test_query)

Notify { '*** query results ***\r':
  message => "data: ${test_results}",
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/89e396e9-e4f0-44b1-bc71-efaf99829556%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to