community.network.exos_vlans – Manage VLANs on Extreme Networks EXOS devices.

Note

This plugin is part of the community.network collection (version 3.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.network.

To use it in a playbook, specify: community.network.exos_vlans.

New in version 0.2.0: of community.network

Synopsis

  • This module provides declarative management of VLANs on Extreme Networks EXOS network devices.

Parameters

Parameter Choices/Defaults Comments
config
list / elements=dictionary
A dictionary of VLANs options
name
string
Ascii name of the VLAN.
state
string
    Choices:
  • active
  • suspend
Operational state of the VLAN
vlan_id
integer / required
ID of the VLAN. Range 1-4094
state
string
    Choices:
  • merged
  • replaced
  • overridden
  • deleted
The state the configuration should be left in

Notes

Note

Examples

# Using deleted

# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_20",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 20
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_30",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 30
#         },
#       }
#     ]
#   }
# }

- name: Delete attributes of given VLANs
  community.network.exos_vlans:
    config:
      - vlan_id: 10
      - vlan_id: 20
      - vlan_id: 30
    state: deleted

# Module Execution Results:
# -------------------------
#
# "after": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     }
# ],
#
# "before": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "vlan_10",
#         "state": "active",
#         "vlan_id": 10
#     },
#     {
#         "name": "vlan_20",
#         "state": "active",
#         "vlan_id": 20
#     }
#     {
#         "name": "vlan_30",
#         "state": "active",
#         "vlan_id": 30
#     }
# ],
#
# "requests": [
#     {
#        "data": null,
#        "method": "DELETE",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=10"
#     },
#     {
#    "data": null,
#        "method": "DELETE",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=20"
#     },
#     {
#    "data": null,
#        "method": "DELETE",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=30"
#     }
# ]
#
#
#  After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       }
#     ]
#   }
# }


# Using merged

# Before state:
# -------------
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       }
#     ]
#   }
# }

- name: Merge provided configuration with device configuration
  community.network.exos_vlans:
    config:
      - name: vlan_10
        vlan_id: 10
        state: active
      - name: vlan_20
        vlan_id: 20
        state: active
      - name: vlan_30
        vlan_id: 30
        state: active
    state: merged

# Module Execution Results:
# -------------------------
#
# "after": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "vlan_10",
#         "state": "active",
#         "vlan_id": 10
#     },
#     {
#         "name": "vlan_20",
#         "state": "active",
#         "vlan_id": 20
#     },
#     {
#         "name": "vlan_30",
#         "state": "active",
#         "vlan_id": 30
#     }
# ],
#
# "before": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     }
# ],
#
# "requests": [
#     {
#        "data": {
#          "openconfig-vlan:vlan": [
#            {
#              "config": {
#                "name": "vlan_10",
#                "status": "ACTIVE",
#                "tpid": "oc-vlan-types:TPID_0x8100",
#                "vlan-id": 10
#             }
#            }
#          ]
#        },
#        "method": "POST",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/"
#      },
#      {
#        "data": {
#          "openconfig-vlan:vlan": [
#            {
#              "config": {
#                "name": "vlan_20",
#                "status": "ACTIVE",
#                "tpid": "oc-vlan-types:TPID_0x8100",
#                "vlan-id": 20
#              }
#            }
#          ]
#        },
#        "method": "POST",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/"
#      },
#        "data": {
#          "openconfig-vlan:vlan": [
#            {
#              "config": {
#                "name": "vlan_30",
#                "status": "ACTIVE",
#                "tpid": "oc-vlan-types:TPID_0x8100",
#                "vlan-id": 30
#              }
#            }
#          ]
#        },
#        "method": "POST",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/"
#      }
#    ]
#
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_20",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 20
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_30",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 30
#         },
#       }
#     ]
#   }
# }


# Using overridden

# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_20",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 20
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_30",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 30
#         },
#       }
#     ]
#   }
# }

- name: Override device configuration of all VLANs with provided configuration
  community.network.exos_vlans:
    config:
      - name: TEST_VLAN10
        vlan_id: 10
    state: overridden

# Module Execution Results:
# -------------------------
#
# "after": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "TEST_VLAN10",
#         "state": "active",
#         "vlan_id": 10
#     },
# ],
#
# "before": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "vlan_10",
#         "state": "active",
#         "vlan_id": 10
#     },
#     {
#         "name": "vlan_20",
#         "state": "active",
#         "vlan_id": 20
#     },
#     {
#         "name": "vlan_30",
#         "state": "active",
#         "vlan_id": 30
#     }
# ],
#
# "requests": [
#     {
#        "data": {
#          "openconfig-vlan:vlan": {
#        "vlan": [
#              {
#                "config": {
#                  "name": "TEST_VLAN10",
#                  "status": "ACTIVE",
#                  "tpid": "oc-vlan-types:TPID_0x8100",
#                  "vlan-id": 10
#                }
#              }
#            ]
#          }
#        }
#     },
#        "method": "PATCH",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/"
#     },
#     {
#    "data": null,
#        "method": "DELETE",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=20"
#     },
#     {
#    "data": null,
#        "method": "DELETE",
#        "path": "/rest/restconf/data/openconfig-vlan:vlans/vlan=30"
#     }
#  ]
#
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "TEST_VLAN10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       }
#     ]
#   }
# }


# Using replaced

# Before state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_20",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 20
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_30",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 30
#         },
#       }
#     ]
#   }
# }

- name: Replaces device configuration of listed VLANs with provided configuration
  community.network.exos_vlans:
    config:
      - name: Test_VLAN20
        vlan_id: 20
      - name: Test_VLAN30
        vlan_id: 30
    state: replaced

# Module Execution Results:
# -------------------------
#
# "after": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "vlan_10",
#         "state": "active",
#         "vlan_id": 10
#     },
#     {
#         "name": "TEST_VLAN20",
#         "state": "active",
#         "vlan_id": 20
#     },
#     {
#         "name": "TEST_VLAN30",
#         "state": "active",
#         "vlan_id": 30
#     }
# ],
#
# "before": [
#     {
#         "name": "Default",
#         "state": "active",
#         "vlan_id": 1
#     },
#     {
#         "name": "vlan_10",
#         "state": "active",
#         "vlan_id": 10
#     },
#     {
#         "name": "vlan_20",
#         "state": "active",
#         "vlan_id": 20
#     },
#     {
#         "name": "vlan_30",
#         "state": "active",
#         "vlan_id": 30
#     }
# ],
#
# "requests": [
#    {
#       "data": {
#          "openconfig-vlan:vlan": {
#             "vlan": [
#                 {
#                   "config": {
#                      "name": "TEST_VLAN20",
#                      "status": "ACTIVE",
#                      "tpid": "oc-vlan-types:TPID_0x8100",
#                      "vlan-id": 20
#                   }
#                   "config": {
#                      "name": "TEST_VLAN30",
#                      "status": "ACTIVE",
#                      "tpid": "oc-vlan-types:TPID_0x8100",
#                      "vlan-id": 30
#                   }
#                }
#             ]
#          },
#       "method": "PATCH",
#       "path": "/rest/restconf/data/openconfig-vlan:vlans/"
#    }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-vlan:vlans/
# method: GET
# data:
# {
#   "openconfig-vlan:vlans": {
#     "vlan": [
#       {
#         "config": {
#           "name": "Default",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 1
#         },
#       },
#       {
#         "config": {
#           "name": "vlan_10",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 10
#         },
#       },
#       {
#         "config": {
#           "name": "TEST_VLAN20",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 20
#         },
#       },
#       {
#         "config": {
#           "name": "TEST_VLAN30",
#           "status": "ACTIVE",
#           "tpid": "oc-vlan-types:TPID_0x8100",
#           "vlan-id": 30
#         },
#       }
#     ]
#   }
# }

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
after
list / elements=string
when changed
The resulting configuration model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
before
list / elements=string
always
The configuration prior to the model invocation.

Sample:
The configuration returned will always be in the same format of the parameters above.
requests
list / elements=string
always
The set of requests pushed to the remote device.

Sample:
[{'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}, {'data': '...', 'method': '...', 'path': '...'}]


Authors

  • Jayalakshmi Viswanathan (@jayalakshmiV)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/exos_vlans_module.html