My Life as a Sys Admin

Tag Archives: Riak-Ruby

For the past few days, i was playing with hiera-puppet. I strongly wanted to use hiera in my puppet modules. Yesterday i was going through craigdunn’s blog, there i saw his new blog post about thehiera-http,a Hiera back end to connect to any HTTP RESTful API and return data based on a lookup.hiera-http is available as a rubygem or from craigdunn’sGithub page. In his blog he has clearly explained how he uses hiera-http to query data from couchdb. Since i’m a fan of Riak, i wanted to try the same from Riak.

I used the riak-ruby-clientto pass my json data to Riak. Below is a simple ruby script which i used,

We can test the working using hiera cli hiera-c hiera.yaml db_name
As per the hiera-http dcumentation, we can use the facter variables, so the path can be :paths: /riak/hiera_bucket/%{operatingsystem}. For those who wants a gui for Riak, i prefer rekon. It’s very simple to install and configure, also we can edit our values directly using this.