Chef::Readbag

Get stuff out of chef databags.

Installation

Add this line to your application's Gemfile:

gem 'chef-readbag'

And then execute:

$ bundle

Or install it yourself as:

$ gem install chef-readbag

Usage

Get stuff out of databags:

1.9.3-p194 :001 > require 'chef-readbag'
 => true 
1.9.3-p194 :002 > bag = Chef::Readbag::Bag.new('chef-server:4000', 'example-client', 'path-to-example-client.pem')
 => #<Chef::Readbag::Bag:0x007fa04b2410d8 @host_and_port="chef-server:4000", @client_name="example-client", 
       @client_key_path='path-to-example-client.pem'> 
1.9.3-p194 :003 > bag['hosts/project-name-app-servers']['production']
 => ["project-name-app1", "project-name-app2", "project-name-app3"] 

I use it in capistrano.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request