3

I have created a role myrole inside that i added two receipes under run list

"run_list" : [

"recipe[sala::default],[sala::test]"

]

But it is giving me error.

So later i want to do

knife bootstarp ipaddress -x user -i key --sudo - r role[myrole]

When I run the above command i want to my chef run to execute both the receipes on single run.

Also, can i execute this command with two roles?

knife bootstarp ipaddress -x user -i key --sudo - r role[myrole1,myrole2]
Mad Dog Tannen
  • 7,129
  • 5
  • 31
  • 55
Suresh Sala
  • 425
  • 1
  • 6
  • 17
  • In order to improve the quality of your questions, please make sure to included details instead of "But it is giving me error." – StephenKing Nov 20 '13 at 11:03

1 Answers1

5

Sorry, except typos (bootstarp -> bootstrap) and tiny glitches (- r -> -r) your only problem is that you have to prepend the [sala::test] with a recipe:

run_list" : [
  "recipe[sala::default],recipe[sala::test]"
]

Similar, when bootstrapping, do it like this: -r "role[myrole1],role[myrole2]"

EDIT: the json example was incorrect. This should work:

run_list" : [
  "recipe[sala::default]",
  "recipe[sala::test]"
]
StephenKing
  • 36,187
  • 11
  • 83
  • 112
  • when i do this"recipe[sala::default],recipe[sala::test]" im getting this error: ArgumentError: Unable to create Chef::RunList::RunListItem from String:"recipe[sala::default],recipe[sala::test]": must be recipe[] or role[] @StephenKing – Suresh Sala Nov 20 '13 at 11:21
  • bootstapping using two role can be done @Stephenking but error in runlist when i use two recipes – Suresh Sala Nov 20 '13 at 12:07