Skip to content

Latest commit

 

History

History
141 lines (115 loc) · 6.08 KB

comware_switchport_module.rst

File metadata and controls

141 lines (115 loc) · 6.08 KB

comware_switchport

Added in version 1.0

Manage Layer 2 parameters on switchport interfaces

parameter required default choices comments
name yes Full name of the interface
link_type yes
  • access
  • trunk
  • hybrid
Layer 2 mode of the interface
pvid no If link_type is set to trunk this will be used as the native native VLAN ID for that trunk. If link_type is set to access then this is the VLAN ID of the interface.
permitted_vlans no If mode is set to trunk this will be the complete list/range (as a string) of VLANs allowed on that trunk interface. E.g. 1-3,5,8-10 Any VLAN not in the list will be removed from the interface.
untaggedvlan no E.g. 1-3,5,8-10
taggedvlan no E.g. 1-3,5,8-10
state no present
  • present
  • default
  • absent
Desired state of the switchport
hostname yes IP Address or hostname of the Comware v7 device that has NETCONF enabled
username yes Username used to login to the switch
password yes Password used to login to the switch
port no 830 NETCONF port number
look_for_keys no False Whether searching for discoverable private key files in ~/.ssh/


# Basic access config
- comware_switchport: name=FortyGigE1/0/2 link_type=access pvid=3 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

# Basic trunk config
- comware_switchport: name=FortyGigE1/0/2 link_type=trunk permitted_vlans="1-3,5,8-10" username={{ username }} password={{ password }} hostname={{ inventory_hostname }}

Note

If the interface is configured to be a Layer 3 port, the modulewill fail and ask the user to use the comware_interface moduleto convert it to be a Layer 2 port first.If the interface is a member in a LAG, the module will failtelling the user changes hould be made to the LAG interfaceIf VLANs are trying to be assigned that are not yet created onthe switch, the module will fail asking the user to createthem first.If state=default, the switchport settings will be defaulted.That means it will be set as an access port in VLAN 1.