Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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: tickets.opscode.com/browse/CHEF-4405 –  Ryan Jul 26 '13 at 11:18

Your Answer

 
discard

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.