release is a hiera backend.
So if you have a puppet class that takes a list of hosts as a parameter you
can now fill it using dynamic data from a puppetdb query. No need anymore
to modify the module itself or create a wrapper class around it to do the
puppetdb query in.
It requires another hiera backend to be active at the same time, and that
will be used to define the actual puppetdb query to be used. It does not
matter which backend that is, there can even be several of them. To enable
add the backend `puppetdb`to the backends list in `hiera.yaml`.
So instead of writing something like this in for example your
`hiera-data/common.yaml`:
ntp::servers:
- 'ntp1.example.com'
- 'ntp2.example.com'
You can now instead write:
ntp::servers::_nodequery: 'Class[Ntp::Server]'
It will then find all nodes with the class ntp::server and return an array
containing their certname. If you instead want to return the value of a
fact, for example the `ipaddress`, the nodequery can be a query and fact
tuple, like:
ntp::servers::_nodequery: ['Class[Ntp::Server]', 'ipaddress']
or a hash:
ntp::servers::_nodequery:
query: 'Class[Ntp::Server]'
fact: 'ipaddress'
When returning facts only nodes that actually have the fact are returned,
even if more nodes would in fact match the query itself.
--
Erik Dalén
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.