Adding recipes from to a nodes run_list

Hi folks!
I’m using chef 0.7.16 and want to add a specific recipe to a nodes run_list
like I can do by using the WebUI, but by writing my own script.
I loaded a cookbook and tought about adding it to the run_list. Of cause that
doesn’t work, so I tried to get the single recipes of that cookbook by using

recipes = cookbook.recipes
recipes.each do |recipe|
node.run_list << recipe
end

But after I’ve done that, the recipes don’t apper in the runlist shown in the
WebUI.
What am I doing wrong? Is that maybe the wrong way?

Thanks in advance,
Kris

Don't forget to call 'node.save'

Adam

On Thu, Feb 18, 2010 at 2:48 AM, kristin@counterliero.de wrote:

Hi folks!
I'm using chef 0.7.16 and want to add a specific recipe to a nodes run_list
like I can do by using the WebUI, but by writing my own script.
I loaded a cookbook and tought about adding it to the run_list. Of cause that
doesn't work, so I tried to get the single recipes of that cookbook by using

recipes = cookbook.recipes
recipes.each do |recipe|
node.run_list << recipe
end

But after I've done that, the recipes don't apper in the runlist shown in the
WebUI.
What am I doing wrong? Is that maybe the wrong way?

Thanks in advance,
Kris

--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E: adam@opscode.com