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'm using chef's knife to create EC2 servers (and thus new nodes). I can get it to start with a given single role correctly, but I can't get the command line argument right for multiple roles in the node's run_list. How do I specify multiple roles for the newly created node in the command line (without editing the node JSON in an editor as shown here)?

share|improve this question
up vote 3 down vote accepted

I posted this question on the Opscode support site and received a very prompt response. Quoting from the Opscode support thread:

for chef 0.9.x:

knife ec2 server create ... 'role[foo]' 'role[bar]' 'role[baz]'

for chef 0.10.x:

knife ec2 server create ... -r 'role[foo], role[bar], role[baz]'

Works great, thanks Stephen!

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.