Take the 2-minute tour ×

I want to run:

knife role create blah

I use chef-solo and don't need knife to connect to a server. I just would like to run these commands for helping me prepopulate the files quickly. Everytime I run of these commands it attempts to connect to a server.

This does not happen for

knife cookbook create blah

Double-ewe tee eff.


I've noticed this is the case for databags and environments as well. I've read elsewhere that knife is primarily intended for use with the chef-server API, but it seems ridiculous that something like this can't be done. It just needs to save the darn file.

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

A role on chef server and chef-solo are very different in how they are represented. In chef-server they're stored in a database, whereas chef-solo uses flat JSON or Ruby files.

You'd have to ask opscode why it doesn't work for the chef-solo use case, but my guess is that its just much more involved to create and upload the roles to the database so they aimed to simplify that use case.

Either way, creating roles is pretty simple in Chef-Solo. Just create the directory and the file for the role.


share|improve this answer
add comment

You should take a look at knife-solo

share|improve this answer
add comment

It is very subjective to the package being cookbook'd. The fine folks at EngineYard, in their chef repo have a Rakefile which a task that creates a cookbook with a default layout.

And it wouldn't make sense for a data bag either as - it is a plain json.

Finally, Environments is a Chef-Server only feature, which will not work if you use chef-solo.

share|improve this answer
add comment

Your Answer


