Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

For chef-solo, is it possible to pass the override attributes via command line?

Because sometimes the attribute is just adhoc decision and is diffent from host to host, e.g. hostname, we don't want to create a json file for the sake of adhoc configuration.

share|improve this question

You can use the -j command line option in order to define attributes you may want to override the default ones.

If you want to directly define the options via text, you can use the input redirection feature of bash like:

chef-solo -j <(echo '{ "tags": "awesome" }' )
share|improve this answer
When using -j, you are required to open the file, update and save it. What I want is to provide the adhoc value from commandline. – Ryan Mar 16 '13 at 3:38
It does not work, see: – Ryan Jul 26 '13 at 11:18

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.