Understanding the netdev_stdlib Puppet Resource Types
On the Puppet master, two Puppet modules are required to manage
devices running Junos OS. The first module, netdevops/netdev_stdlib
, includes the Puppet type definitions for the netdev resources.
The netdev resources model the properties for various network resources
and control specific Ethernet switch configuration such as VLANs. Table 1 describes the resource
types defined by the netdev_stdlib
module. In the Puppet manifest, you use the netdev resource types
in resource declarations to specify the desired configurations of
the agent nodes running Junos OS.
The netdev_stdlib
resource
definitions represent a superset of configuration parameters for that
resource. The manifest file should only configure those parameters
that are supported on a given platform or that are relevant to the
given interface type.
Table 1: Resource Types Defined in the netdev_stdlib Module
Type Name | Description |
---|---|
Models the properties of the network device. | |
Models the properties for a physical interface. | |
Models the properties for Layer 2 switching services
on an interface. | |
Models the properties for a link aggregation group (LAG). | |
Models the properties for a VLAN resource. |
The second Puppet module, juniper/netdev_stdlib_junos
, includes the Junos OS-specific code that implements each of
the types defined by netdev_stdlib
. When you install the netdev_stdlib_junos
module on the Puppet master, it automatically installs the netdev_stdlib
module.
In a Puppet manifest, you must specify one and only one netdev_device
for a given node. The netdev provider
code automatically creates dependencies between the netdev_device
resource and the other netdev resources. If the netdev_device
cannot be created, then the Puppet agent does not process the other
resources.
To create the netdev_device
resource,
the Puppet agent must open a NETCONF session with the device running
Junos OS and establish an exclusive lock on the configuration database.
Since the Puppet agent is running on the device, opening a connection
should not fail. However, obtaining an exclusive lock could fail if
another administrator is managing the device and already has a lock
on the configuration database.
The netdev_interface
resource type
models the properties for a physical interface, whereas netdev_l2_interface
models the properties for Layer 2
switching services on an interface. You only need to define the netdev_interface
resource to change physical interface
properties such as speed, MTU, or duplex mode. You do not need to
define a netdev_interface
resource as a
prerequisite for defining a netdev_l2_interface
resource.
The netdev_vlan
resource type models
the properties for a VLAN resource. A netdev_l2_interface
resource can reference VLANs created using netdev_vlan
resources, or it can reference VLANs already existing in the device
configuration. Thus, you do not need to define a netdev_vlan
resource in order to use VLANs in the netdev_l2_interface
definition.
Only the netdev_device
and netdev_interface
resources are supported on OCX1100
switches.
To manage resources that do not have type specifications
in the netdev_stdlib
module, you
can use the apply_group
defined resource
type provided as part of the netdev_stdlib_junos
module.