Chef file locations

When the Chef cookbook is tested in Test Kitchen

The .kitchen.yml file contains the username to run the Chef cookbook. It is specified under platforms:, transport:, username:

Use that value in place of USER_NAME_FROM_KITCHEN_YML below

Cookbook location

When the Chef recipes are executed, all cookbooks are stored on the node. You can examine the code to make sure your latest changes are reflected on the machine.

On Linux

/var/chef/cache/cookbooks

On Linux under Test Kitchen

/tmp/kitchen/cookbooks and
/tmp/kitchen/cache/cookbooks

On Windows

C:\chef\cache\cookbooks

On Windows under Test Kitchen

C:\Users\USER_NAME_FROM_KITCHEN_YML\AppData\Local\Temp\kitchen\cookbooks

 

The log of the Chef client run

The output of the Chef cookbook execution is in the chef.log or chef-client.log file

On Linux

/var/log/chef.log

On Windows

The log of the first Chef Client run. The log entries of the initial Chef Client run are saved here.

C:\chef\chef-client.log

The log of subsequent Chef Client runs. After the initial Chef Client run, the rest of the log entries are collected in this file.

C:\chef\log\client.log

Stacktrace

Chef saves information on the hard drive when scripts are executed. If there is a failure, the stack trace of the last error is saved in the chef-stacktrace.out file.

On Linux

/var/chef/cache/chef-stacktrace.out

On Linux under Test Kitchen

/tmp/kitchen/cache/chef-stacktrace.out

On Windows

C:\chef\cache\chef-stacktrace.out

On Windows under Test Kitchen

C:\Users\USER_NAME_FROM_KITCHEN_YML\AppData\Local\Temp\kitchen\cache\chef-stacktrace.out

Ohai output

All the information that Ohai collects on the instance, is saved in the failed-run-data.json file, even if there is no error. It is a great resource to find get

Cloud info

  • cloud-specific information under “cloud
  • cloud instance information under “ec2

Computer info

  • CPU and memory configuration under “cpu“, “cs_info“, “memory
  • drive sizes and network settings under “filesystem” and “network

Operating system info

  • operating system information under “os_info
  • list of enabled Windows features under “dism_features
  • the list of installed applications under “packages

Chef info

  • Chef client configuration values under “chef_client
  • the Chef node information under “chef_type”: “node
  • the Chef run list under “run_list
  • list of Chef cookbooks and their versions under “cookbooks
  • list of the executed recipes under “recipes
  • the value of the passed in Chef attributes under “normal
  • the value of the Chef cookbook attributes under “chef_client” and the cookbook name
  • all the information on the Chef resources under “json_class
  • the stack trace of the last error under “exception

On Linux

/var/chef/cache/failed-run-data.json

On Linux under Test Kitchen

/tmp/kitchen/cache/failed-run-data.json

On Windows

C:\chef\cache\failed-run-data.json

On Windows under Test Kitchen

C:\Users\USER_NAME_FROM_KITCHEN_YML\AppData\Local\Temp\kitchen\cache\failed-run-data.json

Data Bags

On Linux under Test Kitchen

/tmp/kitchen/data_bags

On Windows under Test Kitchen

C:\Users\USER_NAME_FROM_KITCHEN_YML\AppData\Local\Temp\kitchen\data_bags

 

Leave a Reply