Install Puppet for Junos OS
Support for Puppet is removed as of the releases indicated in Puppet for Junos OS Supported Platforms.
Setting Up the Puppet Master
Juniper Networks provides support for using Puppet to manage certain devices running Junos OS. The Puppet master must be running Puppet open-source edition. Table 1 outlines the version of Puppet that must be installed on the Puppet master in order to manage the different Junos OS variants and releases of Puppet for Junos OS on the client.
Junos OS Variant |
Puppet for Junos OS Version |
Puppet Version |
---|---|---|
Junos OS or Junos OS with Enhanced Automation |
1.0 |
Puppet 2.7.19 or later |
2.0 |
Puppet 3.6.1 or later |
|
Junos OS Evolved |
– |
Puppet 3.8.7 or later |
The Puppet master must also have the following software installed in order to use Puppet to manage devices running Junos OS:
Juniper Networks NETCONF Ruby gem—Ruby gem that enables device management using the NETCONF protocol.
netdevops/netdev_stdlib Puppet module—includes the Puppet type definitions for the netdev resources.
juniper/netdev_stdlib_junos Puppet module—includes the Junos OS-specific code that implements each of the types. When you install this module on the Puppet master, it automatically installs the netdev_stdlib module.
To configure the Puppet master for use with devices running Junos OS:
The Puppet agent identifies with the Puppet master using
SSL. By default, the puppet master service does not sign client certificate
requests. As a result, the Puppet master must approve the agent certificate
the first time an agent tries to connect to the master. After the
Puppet agent node is configured and running, approve the client certificate
on the Puppet master by using the command appropriate for your installation,
for example, by using the puppet cert sign host
command or the puppetserver ca sign --certname host
command.
Configuring the Puppet Agent Node
Juniper Networks provides support for using Puppet to manage certain devices running Junos OS. The setup on the agent node depends on the device and the Junos OS variant running on the device. Certain devices require installing the Puppet agent package on the device, other devices have the Puppet agent integrated into the software image, and some devices support running the Puppet agent as a Docker container. To verify support for a specific platform and determine which setup to use for a given device and Junos OS release, see Puppet for Junos OS Supported Platforms.
Table 2 outlines the tasks required to configure the Puppet agent node for the different types of setups. To configure the node, perform the steps in each linked task.
Puppet Agent Setup |
Tasks |
---|---|
Puppet agent must be installed using the jpuppet package |
Perform the steps in the following tasks: |
Puppet agent is integrated on the device |
Perform the steps in the following tasks: |
Puppet agent will run as a Docker container |
Perform the steps in the following tasks: |
OCX1100 switches, QFX Series switches running Junos OS with Enhanced Automation, and devices running Junos OS Evolved have the Puppet agent integrated with the software. If the device also supports using the Puppet agent Docker container, you can elect to run the Puppet agent as a Docker container instead of using the integrated Puppet agent.
- Installing the Puppet Agent Package
- Configuring the Junos OS User Account
- Configuring the Environment Settings
- Starting the Puppet Agent Process
- Using the Puppet Agent Docker Container
Installing the Puppet Agent Package
To install the Puppet agent on devices running Junos OS that do not have the agent integrated into the software:
Configuring the Junos OS User Account
You must configure a user account to run the Puppet agent. The user must have configure, control, and view permissions. You can configure any username and authentication method for the account.
To configure a Junos OS user account to run the Puppet agent:
Configuring the Environment Settings
Set up the directory structure and environment settings on any agent nodes on which you installed the Puppet agent package or that use the Puppet agent that is integrated with the software image.
To configure the necessary directory structure and environment settings to run the Puppet agent:
Starting the Puppet Agent Process
Devices that have the Puppet agent integrated into the software require that you start the Puppet agent process on the device. Start the Puppet agent process after configuring the Junos OS user account and environment settings.
To start the Puppet agent process:
Using the Puppet Agent Docker Container
Certain devices running Junos OS Evolved support running the Puppet agent as a Docker container. Docker is a software container platform that is used to package and run an application and its dependencies in an isolated container. Juniper Networks provides a Docker image for the Puppet agent on Docker Hub.
When you run the Puppet agent using the Docker container, the container:
Shares the hostname and network namespace of the host
Uses the host network to communicate with the Puppet server
Authenticates to the host using key-based SSH authentication
To use the Puppet agent Docker container on supported devices:
Setting Up the Puppet Configuration File on the Puppet Master and Puppet Agents Running Junos OS
The Puppet configuration file, puppet.conf, defines the settings for the Puppet master and agent nodes. It is an INI-formatted file with code blocks that contain indented setting = value statements. The main code blocks are:
[master]
—settings for the Puppet master.[agent]
—settings for the agent node.[main]
—global settings that are used by all commands and services. The settings in the[master]
and[agent]
blocks override those in[main]
.
On the Puppet master, the configuration file resides at $confdir/puppet.conf. On agent nodes running Junos OS, the location depends on your setup. Table 4 outlines the location where the Puppet configuration file should reside for a given setup on devices running Junos OS.
Puppet agent setup |
puppet.conf location |
---|---|
Puppet agent is installed using the jpuppet package |
$HOME/.puppet directory for the Junos OS user account set up to run the Puppet agent |
Puppet agent is integrated on the device |
$HOME/.puppet directory for the Junos OS user account set up to run the Puppet agent |
Puppet agent is running as a Docker container |
/etc/puppet directory within the container |
Creating environment-specific Puppet configuration files
is beyond the scope of this document. However, when using Puppet to
manage devices running Junos OS, the Puppet master and agent node puppet.conf files must contain the following statement
within the [main]
configuration block:
[main] pluginsync = true
In addition, client devices running Junos OS Evolved
must include the certname
statement in
the puppet.conf file and specify
the node’s certificate name. The Puppet master uses the certificate
name, which can be a hostname, an IP address, or any user-defined
name in lowercase characters, to identify the client.
[main] certname = puppet-client pluginsync = true
The following example shows a sample puppet.conf file for an agent node running Junos OS:
[main] libdir = $vardir/lib logdir = $vardir/log/puppet rundir = $vardir/run/puppet ssldir = $vardir/ssl moduledir = $libdir factpath = $libdir/facter pluginsync = true [agent] server = puppetmaster.example.com classfile = $vardir/classes.txt localconfig = $vardir/localconfig
The following example shows a sample puppet.conf file for an agent node running Junos OS Evolved:
[main] libdir = $vardir/lib logdir = $vardir/log/puppet rundir = $vardir/run/puppet ssldir = $vardir/ssl moduledir = $libdir factpath = $libdir/facter certname = agent01.example.com pluginsync = true [agent] server = puppetmaster.example.com classfile = $vardir/classes.txt localconfig = $vardir/localconfig
For more information about Puppet configuration files, see the Puppet website at https://puppet.com/.
Configuring the Puppet for Junos OS Addressable Memory
On devices running Junos OS, the amount of memory available to Puppet is 64 MB by default. You can expand the usable memory to the system maximum values as defined in Table 5.
Device |
Upper Memory Limit |
---|---|
EX4200, EX4500, EX4550 |
128 MB |
EX4300 |
64 MB |
MX5, MX10, MX40, MX80 |
64 MB |
MX104 |
64 MB |
MX240, MX480, MX960 |
2048 MB |
OCX1100 |
64 MB |
QFX3500, QFX3600 |
1024 MB |
QFX5100 |
64 MB |
QFX10002, QFX10008, QFX10016 |
1024 MB |
To expand the amount of memory available to the Puppet agent execution environment, including the Puppet agent and Facter processes: