Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You should take a look at knife-solo

share|improve this answer

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.