Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Installing or Uninstalling the Chef Client on Juniper Networks Devices Running Junos OS

 

This topic describes how to install, upgrade, or uninstall the Chef client on Juniper Networks devices running Junos OS.

Note

The Chef client is automatically installed on Juniper Networks switches running Junos OS with Junos Automation Enhancements. If your switch is running Junos OS with Junos Automation Enhancements, skip this installation procedure and configure the Chef client as described in Configuring the Chef Client on Juniper Networks Devices Running Junos OS.

For more information on Junos Automation Enhancements, see Junos Automation Enhancements Documentation.

This topic covers:

Devices Supporting Chef for Junos OS

See the Chef for Junos OS Release Notes for information about which Juniper Network devices support Chef clients.

Installing the Chef Client Overview

The Chef client is part of an installation package that includes the Chef client, Ohai, the Ruby Interpreter, and junos-ez-stdlib.

On a device with redundant Routing Engines, you must run the Chef client from the master Routing Engine.

When the Chef client runs, it obtains an exclusive configuration lock, which it releases after it commits all pending configuration changes. If you enable the reporting add-on on your Enterprise Chef server, the Chef client reports the results of the run back to the server. On successful Chef client runs, the Chef client sends a list of updated resources to the server; on failed Chef client runs, it sends a full exception stacktrace to the server.

The configuration of a resource on a managed node always reflects the resource state defined in the last recipe that was run that contains that resource. For example, if you run a recipe that defines a LAG resource as containing the member links ge-0/0/0 and ge-0/0/1 and then later run a recipe that defines the same LAG resource as containing the member links ge-0/0/2 and ge-0/0/03, the resulting configuration for the LAG on the managed node contains only the member links ge-0/0/2 and ge-0/0/3.

Installing or Upgrading the Chef Client

To install or upgrade the Chef client on a Juniper Networks device:

Note

The procedure to upgrade a Chef client is the same as that of installation. During an upgrade, the previous version of the Chef client is overwritten with the latest version.

  1. Access the Chef for Junos OS download page at https://www.juniper.net/support/downloads/?p=chefforjunos#sw.

    The Chef for Junos OS Release Notes are also available at the download site. Consult them for information about what package to install on your platform.

  2. Download the Chef for Junos OS software package that is specific to your platform to the /var/tmp/ directory on the device.Best Practice

    We recommend you install the software package from the /var/tmp/ directory on your device to ensure the maximum amount of disk space and RAM for the installation.

    The following template describes the package naming format of Chef Bundles for Junos:

    chef-<platform>-<chef version>_<SDK indicator>.<Release count>.tgz

    where:

    • platform is the platform microprocessor architecture whose values can be i386 , powerpc or x86-32.

    • chef version is the version of the Chef client (for example, 11.10.4).

    • SDK indicator indicates the Junos OS SDK infrastructure used to create the package. A 1 indicates the Junos SDK; a 2 indicates the Junos Extension Toolkit (JET).

    • Release count is the version of Juniper Networks version of the package.

    You must use the installation package that matches the microprocessor architecture of your device. If you do not know the architecture used by your device, you can use the UNIX shell command uname -a to determine it.

  3. If you are accessing a Juniper device externally through remote access, you must configure the device for external remote access through SSH. For more information on configuring a Juniper device for external remote access, see Configuring SSH Service for Remote Access to the Router or Switch.
  4. In the Junos OS CLI, enter configuration mode.

    user@host> configure

  5. Configure the provider name, license type, and deployment scope associated with the application.

    [edit]
    user@host# set system extensions providers chef license-type juniper deployment-scope commercial
    user@host# commit and-quit

  6. Install the software package by using the request system software add operational mode command.

    user@host> request system software add /var/tmp/chef-package.tgz

  7. Verify that the installation is successful by issuing the show version operational mode command.

    If the installation is successful, the list of installed software includes the Chef, Ruby Interpreter, and junos-ez-stdlib packages. For example:

    • If your installation package was built with the Junos Extension Toolkit, only one package is installed, JET app chef. This package includes all the required components, including the Ruby Interpreter and junos-ez-stdlib. To verify the installation:

      user@host> show version | match chef
    • If your installation package was built with the Junos SDK, three packages are installed: the Chef, Ruby Interpreter, and junos-ez-stdlib packages. To verify the installation:

      user@host> show version

After you install the Chef client, you must configure it as described in Configuring the Chef Client on Juniper Networks Devices Running Junos OS.

Uninstalling the Chef Client from the Juniper Networks Device

To uninstall the Chef client from the Juniper Networks device, use the request system software delete CLI command to delete the installed packages. For example:

  • To delete a Chef client package built by the Junos Extension Toolkit (JET), enter:

    user@host> request system software delete chef

  • To delete the Chef client and related packages built by the Junos SDK, enter:

    user@host> request system software delete chef user@host> request system software delete junos-ez-stdlib user@host> request system software delete ruby