The slxos_netdev_vlan type allows you to manage VLANS on a switch.


netdev_vlan { "name":
vlan_id => VLAN_id,
description => "vlan-description",
target => $target


Table 1. slxos_netdev_vlan properties
Property Description
name (required) Specifies the name of the VLAN. For example “blue”.
description Assigns the description value to the VLAN. The default is: “Puppet created VLAN: <name>: <vlan-id>” . THe VLAN tag-ID value range is from 1 through 4095.
target (optional) Specifies device connection information. For example, http://admin:password@[3001::1]:830 NOTE: The target can also be specified by using a shortcut. An example is: $ip23= "http://admin:password@; you can then use $ip23 subsequently.


The following Puppet code segment configures several VLANs and associated properties for each of these VLANS.

class node1 {
$ip23= "http://admin:password@"
$vlans= {
'v10' => {ensure => present, vlan_id =>10, description => 'Vlan 10', target
'v11' => {ensure => present, vlan_id =>11, description => 'Vlan 11', target
'v12' => {ensure => present, vlan_id =>12, description => 'Vlan 12', target
'v13' => {ensure => present, vlan_id =>13, description => 'Vlan 13', target
'v14' => {ensure => present, vlan_id =>14, target =>$ip23},
}create_resources(slxos_netdev_vlan, $vlans)}

Use the show running interface vlan command to verify the results of the code segment on the switch.

device# show run interfcae vlan
interface Vlan 1
interface Vlan 10
description Vlan 10
interface Vlan 11
description Vlan 11
interface Vlan 12