I use Erik Dalén's puppetdbquery module to do this sort of thing from
the puppet DSL.
https://forge.puppetlabs.com/dalen/puppetdbquery



On 12 December 2014 at 10:06, Wyatt Alt <wy...@puppetlabs.com> wrote:
> Abhi,
>
> Try this:
> curl -X GET http://localhost:8080/v4/facts/ipaddress --data-urlencode
> 'query=["in","certname",["extract","certname",["select-nodes",["=",["fact","kernel"],"Linux"]]]]
>
> Wyatt
>
>
> On 12/11/14 12:14 PM, a...@littlewiki.in wrote:
>
> Hello.
>
> I want to get the ip-addresses of all Linux machines. Here's my query using
> curl
>
> query=["=", "name", "ipaddress"],["in", "certname",["extract", "certname",
> ["select-nodes",["and",["=", "name", "kernel"],["=", "value", "Linux"]]]]]
>
>
> This returns me the ipaddresses of all the machines. If I add an and
> condition to the two blocks, it returns a query malformed error.
> Essentially, I want to get nodes that match factA=B and factC=D and return
> factX. and factY of each matched node.
>
>
> How do I go about doing this?
>
> --
> Abhi
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/8fd9d60b-4e25-4e25-8c98-7559bec45ba4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/548A3198.8030901%40puppetlabs.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Pete Brown
Director and Primary Systems Engineer
Abstract IT Pty Ltd.

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAM8R_x-aMVSofUiT8gsDCjBT8_7eZAiwfqe0uRUFOgLOfOpzcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to