Distribution deployment of recipes


#1

Hello

I am working on window 2012 r2. Here I am deploying recipes directly from chef-workstation to chef-node without chef-server.

I am running below scenario:

  1. I have a one chef-workstation VM and 2 chef-client nodes (chef-client1 and chef-client2)
  2. I generated a cookbook with the name testcookbook, which has two recipes (recipe_1.rb and recipe_2.rb).

recipe_1.rb

directory 'C:/test_1' do
    action :create
end

recipe_2.rb

directory 'C:/test' do
   action :create
end
  1. Presently I am running individual chef command to deploy recipe on chef-client1 and chef-client2.
    a. chef-run winrm://username@chef-client1 recipes\recipe_1.rb --password Password
    b. chef-run winrm://username@chef-client2 recipes\recipe_2.rb --password Password

I want to deploy recipes with a single command.
What I need to change in my recipes, so they know which recipe is needed to install on which chef-clients?


#2

Run lists, or roles would fix your problem but you would need a chef server for that.