Open fatmcgav opened 8 years ago
OK, after a bit of testing, it looks like appending the query param to the lookup works...
e.g.
$mongo_nodes = hiera('mongodb?dc=StgSVCs', [])
So the question then becomes, is this sufficient support?
Hi, It's a way to do it, another way would be to add a helper function to iterate through the results :) Would that be useful for you?
@lynxman The above is sufficient for my needs.
However a helper function that allows a wider range of options, such as filtering for multiple DC's, might make sense...
Cool, will add it to my todo
I'm currently implementing a platform whereby we're levering Consul for SD and Puppet for automation, and have a challenge whereby the PuppetMaster sits in one Consul DC (e.g CoreSVCs), and I'm trying to query for Consul registered services in another DC (e.g StgSVCs).
Currently, hiera-consul queries the 'agents' DC, in this case that of the PuppetMaster...
The HTTP API supports querying other DC's by passing a
?dc=
query param...Before I dive in and try and implement something in hiera-consul, I wanted to find out whether other people would have a use for this functionality, how best to support it etc...
Thoughts?
Cheers Gavin