Desired State Configuration (DSC) is a well-known concept used to manage larger amounts of infrastructure. Chef is one of the tools commonly used to implement this approach.
Recently, Chef has changed its licensing model and downloading and using Chef software now requires a valid license. As a result, you may see licensing warnings when bootstrapping new nodes using the knife bootstrap command.
In this blog post, we’ll discuss what needs to be done to get rid of the licensing warning that appears during the knife bootstrap process and how to provide a valid Chef license when installing Chef Infra Client on a new server.
Prerequisites:
A Chef Infra Server
A machine with Chef Workstation installed. Chef Workstation provides the tools required to manage the Chef environment, including commands such as knife and other Chef CLI commands. In this sample, we use Azure DevOps agent with Chef Workstation
A valid Chef license key
When adding a new server to a Chef Infra Server environment, the Chef Infra Client needs to be installed on the server that you want to manage. There are several ways to install Chef Infra Client. In this blog post, we will focus on using the knife bootstrap command.
A typical bootstrap command looks something like below. The bootstrap process connects to the target server, installs Chef Infra Client, and registers the node with the Chef Infra Server.
knife bootstrap -o winrm <nodeip> -U <nodeuser> -P <nodepw> --node-name <nodename> --server-url <chefInfra server url> --key <private key file that knife uses to authenticate with the Chef Infra Server> --config <Chef configuration file> --user <Chef Infra Server User> --yes -VV
With the recent Chef licensing changes, you may see a message similar to the following during the bootstrap process:
The message indicates that Chef now requires a valid license and recommends providing one when installing Chef Infra Client. A valid license can be obtained through the Progress Chef portal, depending on your organization's licensing arrangement. You may also be able to use a trial license.
To avoid the licensing warning, we need to make a small change to the knife bootstrap command as below. Make sure to provide the license key securely. For example, if you are using Azure DevOps, store the key as a secret variable rather than exposing it directly in your pipeline or scripts.
knife bootstrap -o winrm <nodeip> -U <nodeuser> -P <nodepw> --node-name <nodename> --server-url <chefInfra server url> --key <private key file that knife uses to authenticate with the Chef Infra Server> --config <Chef configuration file> --user <Chef Infra Server User> --yes -VV --chef-license-key <CHEF_LICENSE_KEY>
After adding the license information to the bootstrap command, the bootstrap process should proceed without the licensing warning.The command will install a valid Chef Infra Client version on the target server and register it with the Chef Infra Server.
No comments:
Post a Comment