- Open a
cmdersession - Install chefdk chocolatey package : Chef development kit
$ choco install chefdk -y
Knife is an essential tool in the chef workflow. However it requires some configuration to be able to use it for local development against a ChefZero server.
Positioned at the Repo root, cd into the chef directory and then execute the knife-init.bat command.
$ cd chef
$ knife-init
Positioned at the Repo root, cd into the chef directory and then execute the run.bat command. This will run the cookbooks/mybook default recipe.
$ cd chef
$ run
If you want to run a specific recipe append the -o flag to the run command as follows:
$ run -o mybook::specific_recipe
To run in debug mode append the options -l debug to the command. We can use tee to redirect the STDOUT to a log file.
$ run -l debug | tee logs.ignore.txt
berks cookbook cookbooks/mynewbook: gives a complete folder structurechef generate cookbook cookbooks/mynewbook: adds kitchen, tests and other folders