alliedtelesis.awplus.awplus_vlans (1.2.2) — module

Manages VLAN configuration of AlliedWare Plus devices

| "added in version" 2.10.4 of alliedtelesis.awplus"

Authors: Darryl Alang

preview | supported by network

Install collection

Install with ansible-galaxy collection install alliedtelesis.awplus:==1.2.2


Add to requirements.yml

  collections:
    - name: alliedtelesis.awplus
      version: 1.2.2

Description

This module manages VLAN configuration of AlliedWare Plus devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using merged

# Before state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.1(u) port1.0.2(u) port1.0.3(u)
#                                          port1.0.4(u)

- name: Merge provided configuation to device configuation
  alliedtelesis.awplus.awplus_vlans:
    config:
      - vlan_id: 2
        name: MONO
      - vlan_id: 3
        state: suspend
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.1(u) port1.0.2(u) port1.0.3(u)
#                                          port1.0.4(u)
# 2       MONO             STATIC  ACTIVE
# 3       VLAN0003         STATIC  SUSPEND


# Using replaced

# Before state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.1(u) port1.0.2(u) port1.0.3(u)
#                                          port1.0.4(u)
# 2       MONO             STATIC  ACTIVE
# 3       VLAN0003         STATIC  SUSPEND

- name: Replace device configuation with provided configuation
  alliedtelesis.awplus.awplus_vlans:
    config:
      - vlan_id: 2
        state: suspend
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.1(u) port1.0.2(u) port1.0.3(u)
#                                          port1.0.4(u)
# 2       VLAN0002         STATIC  SUSPEND
# 3       VLAN0003         STATIC  SUSPEND


# Using overridden

# Before state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.3(u) port1.0.4(u)
# 2       MONO             STATIC  ACTIVE  port1.0.2(u)
# 3       VLAN0003         STATIC  SUSPEND port1.0.3(t)
# 4       VLAN0004         STATIC  ACTIVE  port1.0.3(t)
# 5       VLAN0005         STATIC  ACTIVE
# 6       VLAN0006         STATIC  ACTIVE
# 99      VLAN0099         STATIC  ACTIVE  port1.0.1(u)

- name: Override device configuation with provided configuation
  alliedtelesis.awplus.awplus_vlans:
    config:
      - vlan_id: 2
        state: suspend
        name: moonchild
    state: overridden
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.1(u) port1.0.2(u) port1.0.3(u)
#                                          port1.0.4(u)
# 2       moonchild        STATIC  SUSPEND


# Using deleted

# Before state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.3(u) port1.0.4(u)
# 2       MONO             STATIC  ACTIVE  port1.0.2(u)
# 3       VLAN0003         STATIC  SUSPEND port1.0.3(t)
# 4       VLAN0004         STATIC  ACTIVE  port1.0.3(t)
# 5       VLAN0005         STATIC  ACTIVE
# 6       VLAN0006         STATIC  ACTIVE
# 99      VLAN0099         STATIC  ACTIVE  port1.0.1(u)


- name: Delete all vlans
  alliedtelesis.awplus.awplus_vlans:
    config:
      - vlan_id: 5
      - vlan_id: 6
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.3(u) port1.0.4(u)
# 2       MONO             STATIC  ACTIVE  port1.0.2(u)
# 3       VLAN0003         STATIC  SUSPEND port1.0.3(t)
# 4       VLAN0004         STATIC  ACTIVE  port1.0.3(t)
# 99      VLAN0099         STATIC  ACTIVE  port1.0.1(u)


# Using Deleted without any config passed

# Before state:
# -------------
# awplus#show vlan all
# VLAN ID  Name            Type    State   Member ports
#                                          (u)-Untagged, (t)-Tagged
# ======= ================ ======= ======= ====================================
# 1       default          STATIC  ACTIVE  port1.0.3(u) port1.0.4(u)
# 2       MONO             STATIC  ACTIVE  port1.0.2(u)
# 3       VLAN0003         STATIC  SUSPEND port1.0.3(t)
# 4       VLAN0004         STATIC  ACTIVE  port1.0.3(t)
# 5       VLAN0005         STATIC  ACTIVE
# 6       VLAN0006         STATIC  ACTIVE
# 99      VLAN0099         STATIC  ACTIVE  port1.0.1(u)

- name: Delete all vlans
  alliedtelesis.awplus.awplus_vlans:
    state: deleted

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    default: merged
    description:
    - The state the configuration should be left in
    - Note that I(state=deleted) and I(state=overridden) will not remove the default vlan
      1.
    type: str

config:
    description: The provided configuration.
    elements: dict
    suboptions:
      name:
        description:
        - The ASCII name of the VLAN. Maximum length is 32 characters.
        type: str
      state:
        choices:
        - active
        - suspend
        description:
        - Operational state of the VLAN
        type: str
      vlan_id:
        description:
        - The ID of the VLAN to enable or disable, in the range 1-4094.
        required: true
        type: int
    type: list

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - vlan 4 name airplane state disable
  type: list