Mikyjpeg
Mikyjpeg

Reputation: 1219

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:

Upvotes: 1

Views: 2760

Answers (2)

Tensibai
Tensibai

Reputation: 15784

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.

Upvotes: 0

coderanger
coderanger

Reputation: 54181

Normally this file comes from your Chef Server as part of the Starter Kit ZIP file download, which also includes your user key. If you aren't using the Chef Manage interface, you will have to research writing it yourself, the user experience isn't great there.

For the most part all you need is something like this:

node_name 'myusername'
client_key '/path/to/user.pem'
chef_server_url 'https://something.com/organizations/myorg'

Upvotes: 1

Related Questions