This looks nice. Although I think that for the usecase you are
presenting with nagios resources it will be much easier to use
puppetdbquery[1]. The script you wrote might have other usecases. Nice
work again :)

-- 
Nikola

On Thu, Mar 13, 2014 at 02:56:18PM -0700, Daniele Sluijters wrote:
> Good news everyone,
> 
> After about 4hrs of food, beer and code Ewoud Kohl van Wijngaarden (ekohl 
> on Github) and I are intoxicated to release puppetdb-stencil. 
> Puppetdb-stencil is designed to render resource types based on a template.
> 
> The canonical example of this is the nagios types in Puppet:
> 
> $ cd examples && python ../puppetdb-stencil.py nagios_host nagios_hostgroup
> define host {
>     host_name node1.example.com
>     hostgroups +mysql
>     use mysql
>     alias MySQL Cluster node node1.example.com
>     address node1.example.com
> }
> [..]
> 
> define hostgroup {
>     hostgroup_name mysql
>     alias MySQL Cluster 1
> }
> [..]
> 
> On a PuppetDB with 600+ machines and 900+ host groups generating the files 
> for these types takes about 1s in total.
> 
> Because of the templating this principle can be applied to any resource 
> available through PuppetDB as long as a template is created for that type. 
> Templating is done with the Jinja2 library allowing for inheritance and 
> many other advanced templating features.
> 
> This work has been inspired by the work done by eBay/Marktplaats and Github.
> 
> You can find puppetdb-stencil at: 
> https://github.com/daenney/puppetdb-stencil.
> 
> We expect to shortly add:
> * packaging and availability through PyPi
> * additional configuration switches to fully configure connecting to 
> PuppetDB
> * allow for an arbitrary query to be passed in to the resource request
> * allow to specify a file to which the output will be written instead of 
> stdout
> * tests, Travis integration and the works
> 
> -- 
> Daniele Sluijters
> 
> -- 
> 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/bcfd1735-42f5-40ca-8d33-959ebcd8e1cd%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/20140320164700.GA3582%40nikolavp-desktop.
For more options, visit https://groups.google.com/d/optout.

Reply via email to