Issue #18877 has been updated by R.I. Pienaar.

Personally I found a simple query language similar to below the most useful, 
the actual language is something we'd need to spend some time designing and for 
best value we should harmonise this and the collection syntax.

<pre>
# nodes with apache class or lighttpd class in the same dc as me, supports regex
$nodes = find_nodes("(apache or lighttpd) and dc=$mydc")
$node_names = keys($nodes)
$host1_ipaddress = $nodes["host_1"]["ipaddress"]

# nodes in my dc that manages a certain resource
$nodes = find_nodes("Package[httpd] and dc=$mydc")
</pre>

We'd ideally have the same ability in a face on the cli.

I started on a little DSL for this in 
https://github.com/ripienaar/ruby-puppetdb - Dan and Nan has kind of done a 
bunch of stuff to it, I am not sure where it stands today but they have used 
this kind of thing a lot, certainly worth asking Dan for input.  We spent a bit 
of time plugging this into the community puppetdb query functions but never 
completed the task

I'd add a couple of simple utilities like node_facts("some.node") or 
resource_properties("some.node", "Mysql::Instance[production]") - though this 
last one is potentially really scary from a data privacy point of view but we 
dont have any controls around this anyway now.

----------------------------------------
Feature #18877: Extend search capabilities in the Puppet DSL
https://projects.puppetlabs.com/issues/18877#change-81946

Author: James Turnbull
Status: Unreviewed
Priority: Normal
Assignee: 
Category: exported resources
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Currently searching and using data in the Puppet DSL relies on the 
functionality of exported resources. This feature proposes extending the Puppet 
DSL to support a wider range of data from PuppetDB. This could be done through:

1. Syntax additions to the DSL (@@ on steroids)
2. Search functions
3. Others?

I am sure I am seeing this from a limited perspective and am happy to have 
anyone iterate on the concept or suggest alternative and potentially more 
elegant solutions.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to