Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Configuring the Chef Client on Juniper Networks Devices Running Junos OS

 

To enable the Chef client to communicate with the Chef server, you must configure the Chef client after it is installed on the Juniper Networks device.

Note

You must set up the Chef workstation and the Chef server so that they can communicate before you perform this procedure.

To configure the Chef client:

  1. On your Juniper Networks device that is running Junos OS, log in as the root user and create the /var/db/chef directory.

    mkdir -p /var/db/chef

  2. Copy your validation key into the /var/db/chef directory.

    If you do not have your validation key, you can obtain it as follows:

    • If you are using Open Source Chef, you can obtain your validation key from /etc/chef on your server. The key is named chef-validator.pem.

    • If you are using Enterprise Chef (hosted or on-premise), you can obtain your validation key from the Enterprise Chef management console. The key is named orgname-validator.pem, where orgname is your organization name.

  3. Create a client.rb file with the following statements in /var/db/chef directory:

    where:

    • chef_server_url is the URL of your Chef server

    • validation_client_name is chef-validator if you are using Open Source Chef and orgname-validator if you are using Enterprise Chef

    • node_name is optional if the switch has a hostname configured

    • validation_key is chef-validator.pem if you are using Open Source Chef and orgname-validator.pem if you are using Enterprise Chef

    For more information about the settings in the client.rb file, see https://docs.chef.io/config_rb_client.html.

  4. Run the Chef client.
    • If the Juniper Networks version of the Chef client is 2.x (for example, Chef client version 11.10.4_2.0), enter:

      %/opt/jet/chef/bin/ruby /opt/jet/chef/bin/chef-client -c /var/db/chef/client.rb

    • If the Juniper Networks version of the Chef client is 1.x (for example, Chef client version 11.10.4_1.1), enter:

      %/opt/sdk/chef/bin/ruby /opt/sdk/chef/bin/chef-client -c /var/db/chef/client.rb

    These commands assume that your client.rb file resides in the /var/db directory. We recommend using this directory.