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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request