Erik Dalén
2013-May-27 18:44 UTC
[Puppet Users] Puppetdbquery 1.1.0, now featuring hiera backendception
I just released dalen-puppetdbquery 1.1.0, one cool new feature in this 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.
Martijn
2013-May-28 07:53 UTC
[Puppet Users] Re: Puppetdbquery 1.1.0, now featuring hiera backendception
That is very cool, Erik, and looks very useful. Thanks, Martijn Op maandag 27 mei 2013 20:44:19 UTC+2 schreef Erik Dalén het volgende:> > I just released dalen-puppetdbquery 1.1.0, one cool new feature in this > release is a hiera backend. > >-- 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.
Cody Herriges
2013-May-30 17:38 UTC
Re: [Puppet Users] Re: Puppetdbquery 1.1.0, now featuring hiera backendception
Really awesome. On Tue, May 28, 2013 at 12:53 AM, Martijn <martijn@heemels.com> wrote:> That is very cool, Erik, and looks very useful. > > Thanks, > Martijn > > Op maandag 27 mei 2013 20:44:19 UTC+2 schreef Erik Dalén het volgende: > >> I just released dalen-puppetdbquery 1.1.0, one cool new feature in this >> release is a hiera backend. >> >> -- > 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. > > >-- 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.