The quickest way to get started using Chef Infra is to install Chef Workstation and create your first Chef Infra Cookbook:
Install Chef Workstation: https://www.chef.io/downloads/tools/tools/workstation.
Generate a Chef Infra repository with an example cookbook:
chef generate repo my_first_repo
where my_first_repo is an arbitrary name for your Chef Infra repository.
Navigate to the cookbooks/example directory.
Update the cookbooks/example/recipes/default.rb recipe in the generated cookbook to contain:
file "#{ENV['HOME']}/test.txt" do
content 'This file was created by Chef Infra!'
end
Run Chef Infra Client using the default.rb recipe:
chef-client --local-mode --override-runlist example
This creates a file named test.txt at the home path on your computer. Open that file and it will say This file was created by Chef Infra!.
There’s a lot more that Chef Infra can do, obviously, but that was super easy!
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/quick_start/