chef / 17.9.18 / desktop / nodes / index.html /

Deploy Desktop Cookbook to a Node

Configure the node

Once you have uploaded the policy to server, now you are ready to try out your Chef Desktop cookbook on your first test node. Before you begin, you need to:

Bootstrap the First Test Node

  1. Create a client.rb file with the basic information needed to connect to the Chef Infra Server instance
  2. Identify a ‘test node’ - a virtual machine or laptop/desktop that you can test your working cookbook against
  3. Get the serial number of your ‘test node’

From your workstation, configure the server and the client.rb file for your node. S90T7HK2 is an example node serial number.

Create a client.rb

Create a local client.rb file with settings similar to:

validation_client_name 'my_org-validator'
validation_key         File.expand_path('c:\chef\my_org-validator.pem')
chef_server_url        "https://my.fqdn.com/my_chef_server_instance"
ssl_verify_mode        :verify_peer
local_key_generation   true
rest_timeout           30
http_retry_count       3
chef_license           'accept'
node_name              'S90T7HK2'

Identify a Test Node

C:\> knife node create S90T7HK2
Created node [S90T7HK2]

Apply the Chef Desktop Policy

Use knife node policy set to apply the policy to a node.

Use the name of the policy specified in the Policyfile.rb that was uploaded to the Chef Infra Server.

knife node policy set S90T7HK2 'Windows_Node_Policy_Group' 'desktop-config'

Install the Chef Infra Client

Go to your test node and install the Chef Infra Client from an elevated PowerShell window, or use sudo if you are installing it from MacOS. For additional information, see the Chef Install Script documentation.

On Windows

. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project chef

On macOS

curl -L https://omnitruck.chef.io/install.sh | sudo bash

Load the client.rb

After Chef Infra Client finishes installing, copy the client.rb file with the correct data for your node and Chef Infra Server, and place that in c:\chef.

Load the Key

Then copy the validator.pem file you downloaded from your Chef Infra Server at the beginning of the guide and put it in the same folder.

Deploy the Chef Desktop Cookbook to Your Test Node

Run the client:

chef-client

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/desktop/nodes/