adrianlzt/hiera-postgres-backend — pull request #4 by brynhood (2014-06-07 09:28:22+00:00)
Title: allow more use cases use of hiera

This is a useability improvement which allows to return easier types when possible by the query. I use it with a .sql file like this:
---
parameters: SELECT name,data FROM parameters WHERE node='%{::fqdn}' OR node='%{hostname}' OR node='*' ;
classes: SELECT classname AS classes FROM classes WHERE node='%{::fqdn}' OR node='%{hostname}' OR node='*';
default_query: SELECT data FROM parameters WHERE (node='%{::fqdn}' OR node='%{hostname}' OR node='*') AND name='%{key}';

This in turn allows me to do things like hiera_include("classes",'') and use the backend to drive stuff like class repmgr ($nodeid = '') where the nodeid comes right out of hiera-postgres-backend.