Chef configuration file

You can manually configure a Chef configuration file. A Chef configuration file contains the following items:

After Chef starts up, the Chef client sends its key file specified in the Chef configuration file to the Chef server for authentication request. The Chef server compares its local key file for the client with the received key file. If the two files are consistent, the Chef client passes the authentication. The Chef client then downloads the resource file to the directory specified in the Chef configuration file, loads the settings in the resource file, and outputs log messages as specified.

Table 49: Chef configuration file description

Item

Description

(Optional.) log_level

Severity level for log messages.

Available values include :auto, :debug, :info, :warn, :error, and :fatal. The severity levels in ascending order are listed as follows:

  • :debug

  • :info

  • :warn (:auto)

  • :error

  • :fatal

The default severity level is :auto, which is the same as :warn.

log_location

Log output mode:

  • STDOUT—Outputs standard Chef success log messages to a file. With this mode, you can specify the destination file for outputting standard Chef success log messages when you execute the third-part-process start command. The standard Chef error log messages are output to the configuration terminal.

  • STDERR—Outputs standard Chef error log messages to a file. With this mode, you can specify the destination file for outputting standard Chef error log messages when you execute the third-part-process start command. The standard Chef success log messages are output to the configuration terminal.

  • logfilepath—Outputs all log messages to a file, for example, flash:/cheflog/a.log.

If you specify none of the options, all log messages are output to the configuration terminal.

node_name

Chef client name.

A Chef client name is used to identify a Chef client. It is different from the device name configured by using the sysname command.

chef_server_url

URL of the Chef server and name of the organization created on the Chef server, in the format of https://localhost:port/organizations/ORG_NAME.

The localhost argument represents the name or IP address of the Chef server. The port argument represents the port number of the Chef server.

The ORG_NAME argument represents the name of the organization.

validation_key

Path and name of the local organization key file, in the format of flash:/chef/validator.pem.

client_key

Path and name of the local user key file, in the format of flash:/chef/client.pem.

cookbook_path

Path for the resource files, in the format of [ 'flash:/chef-repo/cookbooks' ].