community.general.icx_vlan (0.1.1) — module

Manage VLANs on Ruckus ICX 7000 series switches

Authors: Ruckus Wireless (@Commscope)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

This module provides declarative management of VLANs on ICX network devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a single ethernet 1/1/48 as access(untagged) port to vlan 20
  icx_vlan:
    name: test-vlan
    vlan_id: 20
    interfaces:
      name:
        - ethernet 1/1/48
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a single LAG 10 as access(untagged) port to vlan 20
  icx_vlan:
    vlan_id: 20
    interfaces:
      name:
        - lag 10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a range of ethernet ports as trunk(tagged) ports to vlan 20 by port
  icx_vlan:
    vlan_id: 20
    tagged:
      name:
        - ethernet 1/1/40 to 1/1/48
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add discontinuous lags, ethernet ports as access(untagged) and trunk(tagged) port to vlan 20.
  icx_vlan:
    vlan_id: 20
    interfaces:
      name:
        - ethernet 1/1/40 to 1/1/48
        - ethernet 2/1/1
        - lag 1
        - lag 3 to 5
    tagged:
      name:
        - ethernet 1/1/20 to 1/1/25
        - lag 1 to 3
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove an access and range of trunk ports from vlan
  icx_vlan:
    vlan_id: 20
    interfaces:
      name:
        - ethernet 1/1/40
    tagged:
      name:
        - ethernet 1/1/39 to 1/1/70
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Enable dhcp snooping, disable arp inspection in vlan
  icx_vlan:
    vlan_id: 20
    ip_dhcp_snooping: present
    ip_arp_inspection: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create vlan 20.  Enable  arp inspection in vlan. Purge all other vlans.
  icx_vlan:
    vlan_id: 20
    ip_arp_inspection: present
    purge: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove vlan 20.
  icx_vlan:
    vlan_id: 20
    state: absent

Inputs

    
stp:
    description:
    - Enable spanning-tree 802-1w/rstp for this vlan.
    suboptions:
      enabled:
        description:
        - Manage the state(Enable/Disable) of the spanning_tree_802_1w in the current
          vlan
        type: bool
      priority:
        description:
        - Configures the priority of the bridge. The value ranges from 0 through 65535.
          A lower numerical value means the bridge has a higher priority. Thus, the highest
          priority is 0. The default is 32768.
        type: str
      type:
        choices:
        - 802-1w
        - rstp
        default: 802-1w
        description:
        - Specify the type of spanning-tree
        type: str
    type: dict

name:
    description:
    - Name of the VLAN.
    type: str

delay:
    default: 10
    description:
    - Delay the play should wait to check for declarative intent params values.
    type: int

purge:
    default: false
    description:
    - Purge VLANs not defined in the I(aggregate) parameter.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the VLAN configuration.
    type: str

tagged:
    description:
    - List of ethernet ports or LAGS to be added as trunk(tagged) ports to the vlan. To
      add a range of ports use 'to' keyword. See the example.
    suboptions:
      name:
        description:
        - Name of the interface or lag
        type: list
      purge:
        description:
        - Purge interfaces not defined in the I(name)
        type: bool
    type: dict

vlan_id:
    description:
    - ID of the VLAN. Range 1-4094.
    required: true
    type: int

aggregate:
    description:
    - List of VLANs definitions.
    suboptions:
      associated_interfaces:
        description:
        - This is a intent option and checks the operational state of the for given vlan
          C(name) for associated interfaces. If the value in the C(associated_interfaces)
          does not match with the operational state of vlan interfaces on device it will
          result in failure.
        type: list
      associated_tagged:
        description:
        - This is a intent option and checks the operational state of  given vlan C(name)
          for associated tagged ports and lags. If the value in the C(associated_tagged)
          does not match with the operational state of vlan interfaces on device it will
          result in failure.
        type: list
      check_running_config:
        description:
        - Check running configuration. This can be set as environment variable. Module
          will use environment variable value(default:True), unless it is overridden,
          by specifying it as module parameter.
        type: bool
      delay:
        description:
        - Delay the play should wait to check for declarative intent params values.
        type: int
      interfaces:
        description:
        - List of ethernet ports or LAGS to be added as access(untagged) ports to the
          vlan. To add a range of ports use 'to' keyword. See the example.
        suboptions:
          name:
            description:
            - Name of the interface or lag
            type: list
          purge:
            description:
            - Purge interfaces not defined in the I(name)
            type: bool
        type: dict
      ip_arp_inspection:
        description:
        - Enables dynamic ARP inspection on a VLAN.
        type: bool
      ip_dhcp_snooping:
        description:
        - Enables DHCP snooping on a VLAN.
        type: bool
      name:
        description:
        - Name of the VLAN.
        type: str
      state:
        choices:
        - present
        - absent
        description:
        - State of the VLAN configuration.
        type: str
      stp:
        description:
        - Enable spanning-tree 802-1w/rstp for this vlan.
        suboptions:
          enabled:
            description:
            - Manage the state(Enable/Disable) of the spanning_tree_802_1w in the current
              vlan
            type: bool
          priority:
            description:
            - Configures the priority of the bridge. The value ranges from 0 through 65535.
              A lower numerical value means the bridge has a higher priority. Thus, the
              highest priority is 0. The default is 32768.
            type: str
          type:
            choices:
            - 802-1w
            - rstp
            default: 802-1w
            description:
            - Specify the type of spanning-tree
            type: str
        type: dict
      tagged:
        description:
        - List of ethernet ports or LAGS to be added as trunk(tagged) ports to the vlan.
          To add a range of ports use 'to' keyword. See the example.
        suboptions:
          name:
            description:
            - Name of the interface or lag
            type: list
          purge:
            description:
            - Purge interfaces not defined in the I(name)
            type: bool
        type: dict
      vlan_id:
        description:
        - ID of the VLAN. Range 1-4094.
        required: true
        type: str
    type: list

interfaces:
    description:
    - List of ethernet ports or LAGS to be added as access(untagged) ports to the vlan.
      To add a range of ports use 'to' keyword. See the example.
    suboptions:
      name:
        description:
        - Name of the interface or lag
        type: list
      purge:
        description:
        - Purge interfaces not defined in the I(name)
        type: bool
    type: dict

ip_dhcp_snooping:
    description:
    - Enables DHCP snooping on a VLAN.
    type: bool

associated_tagged:
    description:
    - This is a intent option and checks the operational state of  given vlan C(name)
      for associated tagged ports and lags. If the value in the C(associated_tagged) does
      not match with the operational state of vlan interfaces on device it will result
      in failure.
    type: list

ip_arp_inspection:
    description:
    - Enables dynamic ARP inspection on a VLAN.
    type: bool

check_running_config:
    default: true
    description:
    - Check running configuration. This can be set as environment variable. Module will
      use environment variable value(default:True), unless it is overridden, by specifying
      it as module parameter.
    type: bool

associated_interfaces:
    description:
    - This is a intent option and checks the operational state of the for given vlan C(name)
      for associated interfaces. If the value in the C(associated_interfaces) does not
      match with the operational state of vlan interfaces on device it will result in
      failure.
    type: list

Outputs

commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  sample:
  - vlan 100
  - name test-vlan
  type: list