chef-infra

How to create the chef config.rb file?


I'm learning chef, but I'm confused by unclear documentation and some legacy tools that are replaced but not removed.

Reading this url I see that the configuration file used by the system seems to be a file named config.rb, which replaces knife.rb. I suppose it is the file where I should store all the information to connect the Chef workstation to the Chef server and push the cookbooks.

I'm a new user, so I would like to use this instead of the old one; however, it is not created by default and it is not clear which command should create it.

The page I linked stated this:

A `config.rb` file is used to specify chef-repo-specific configuration details.

    This file is loaded every time this executable is run

The problem is that I don't understand which "this executable" is.. reading this seems that it should exist a chef-repo-specific executable file but there is not...

Which is the executable to call? Should I have to create the file manually using the documentation?

I'm using these versions:


Solution

  • Quote from the page you linked too (In the big yellow box on top):

    The config.rb file is a replacement for the knife.rb file, starting with the chef-client 12.0 release. The config.rb file has identical settings and behavior to the knife.rb file. The chef-client will first look for the presence of the config.rb file and if it is not found, will look for the knife.rb file. If you are using the chef-client 11.x versions in your infrastructure, continue using the knife.rb file.

    I would recommend going through https://learn.chef.io as a new user. There's all details explained.