Puppet, Hiera, and Consul

374 views
Skip to first unread message

Justin Rowles

unread,
Mar 31, 2016, 9:58:37 AM3/31/16
to Puppet Users
For those who would like to expand their use of Hiera to talk to a Consul server/cluster, British Gas Connected Home have made available a gem called bgch-hiera-consul on rubygems.

It derives from lynxman's hiera-consul, but works somewhat differently.  

It fulfils the hiera_hash and hiera_array functionality, and does all parsing of data in Consul value stores for you.  Thus you can embed (currently) json or yaml directly and bgch-hiera-consul will populate your hiera variables (and thus puppet class parameters) for all of the sub entries.

We use this, currently, for our development clusters, where we want to have a quick turnaround in our puppet process.  Instead of editing yaml files, we can manually or  automatically push values to our Consul store, and puppet will pick them up on the next run.

Source and sample code are at https://github.com/ConnectedHomes/hiera-consul

Any feedback, whether in questions, PRs, or complaints, will be appreciated.

Justin.

Brett Swift

unread,
Apr 14, 2016, 5:22:40 PM4/14/16
to Puppet Users
Hey Justin, 

Interesting stuff.  I just deployed a consul cluster for the purpose of DNS - and we haven't yet used the key/value store or the hiera backend.

This is less of a question on your gem, but more on your use case that I'm interested in.   When you say you automatically push values to your consul - do you mean a dev can create a json file or the json file is pulled from somewhere and propagated in a CI/CD type process?  

I guess you made me curious on your automation pipeline and if this is something you leverage in that process. 
Reply all
Reply to author
Forward
0 new messages