�
�Udac @ s� d Z i d d 6d g d 6d d 6Z d Z d Z d Z d
d l Z d
d l m Z d a d
Z
d Z d � Z d � Z
d � Z d � Z d � Z e d k r� e � n d S( s PN CLI vlan-create/vlan-delete s 1.1t metadata_versiont
deprecatedt statust communityt supported_bys�
---
module: pn_vlan
author: "Pluribus Networks (@amitsi)"
version_added: "2.2"
short_description: CLI command to create/delete a VLAN.
deprecated:
removed_in: '2.12'
why: Doesn't support latest Pluribus Networks netvisor
alternative: Latest modules will be pushed in Ansible future versions.
description:
- Execute vlan-create or vlan-delete command.
- VLANs are used to isolate network traffic at Layer 2.The VLAN identifiers
0 and 4095 are reserved and cannot be used per the IEEE 802.1Q standard.
The range of configurable VLAN identifiers is 2 through 4092.
options:
pn_cliusername:
description:
- Provide login username if user is not root.
required: False
pn_clipassword:
description:
- Provide login password if user is not root.
required: False
pn_cliswitch:
description:
- Target switch(es) to run the cli on.
required: False
default: 'local'
state:
description:
- State the action to perform. Use 'present' to create vlan and
'absent' to delete vlan.
required: True
choices: ['present', 'absent']
pn_vlanid:
description:
- Specify a VLAN identifier for the VLAN. This is a value between
2 and 4092.
required: True
pn_scope:
description:
- Specify a scope for the VLAN.
- Required for vlan-create.
choices: ['fabric', 'local']
pn_description:
description:
- Specify a description for the VLAN.
pn_stats:
description:
- Specify if you want to collect statistics for a VLAN. Statistic
collection is enabled by default.
type: bool
pn_ports:
description:
- Specifies the switch network data port number, list of ports, or range
of ports. Port numbers must ne in the range of 1 to 64.
pn_untagged_ports:
description:
- Specifies the ports that should have untagged packets mapped to the
VLAN. Untagged packets are packets that do not contain IEEE 802.1Q VLAN
tags.
s�
- name: create a VLAN
pn_vlan:
state: 'present'
pn_vlanid: 1854
pn_scope: fabric
- name: delete VLANs
pn_vlan:
state: 'absent'
pn_vlanid: 1854
s�
command:
description: The CLI command run on the target node(s).
returned: always
type: str
stdout:
description: The set of responses from the vlan command.
returned: always
type: list
stderr:
description: The set of error responses from the vlan command.
returned: on error
type: list
changed:
description: Indicates whether the CLI caused changes on the target.
returned: always
type: bool
i����N( t
AnsibleModulei� i c C sw | j d } | j d } | j d } | rF | rF d | | f } n d } | d k re | d 7} n | d | 7} | S( s
This method is to generate the cli portion to launch the Netvisor cli.
It parses the username, password, switch parameters from module.
:param module: The Ansible module to fetch username, password and switch
:return: returns the cli string for further processing
t pn_cliusernamet pn_clipasswordt pn_cliswitchs"