Search code examples
chef-infraknife

knife configure --initial using an existing client


I want to initialize a system as a Chef workstation. I was going through the command "knife configure --initial" for the same.

From the documentation, I understood that this asks for the name of a new clientname and contacts the API service to register a new client with the service.

My question is, what would be the steps for using an existing client name configured using the Chef server?

Is there an alternative to : knife configure --initial Please enter a clientname for the new client: ____


Solution

  • If using an existing client, you just have to write your own config file. If you are using the latest version of Chef, you can use a .chef/credentials file like

    [default]
    client_name = yourusername
    client_key = /path/to/user.pem
    chef_server_url = https://mychefserver.com/organizations/myorg