As you have discovered Berkshelf is a great tool for managing cookbooks, but there is no equivalent tool for managing entities like roles, environments and databags. This makes sense as these entities amount to pieces of global data specific to a particular instance of chef.
There are alternative ways to work-around this:
- Use "application" cookbooks containing "role recipes" that detail
the desired run-list
- Export the desired roles and environments and keep a copy in the vagrant repo
Application cookbook pattern
Instead of using a role you use a recipe from a special "application" cookbook. Each recipe is designed to capture the run-list of a particular component of your application: db, appserver, router, etc.
For example the "myapp::db" recipe:
include_recipe "mysql::server"
include_recipe "database"
include_recipe "myapp::_db_schema"
And the "myapp::appserver" recipe
include_recipe "apache2"
include_recipe "php"
..
include_recipe "myapp::_appserver_setup1"
include_recipe "myapp::_appserver_setup2"
The major advantage of this approach over roles is the ability to revision control changes to the run-list (dev/test/prod) and the use of a tool like Berkshelf to control chef server loading.
Export roles and environments from chef server
If you have admin credentials it's easy to export data from chef server. See:
http://docs.opscode.com/knife_download.html