Модуль community.network.exos_l2_interfaces – Управление интерфейсами L2 на устройствах Extreme Networks EXOS.
Примечание
Этот модуль входит в коллекцию community.network (версия 5.0.3).
Возможно, эта коллекция уже установлена, если вы используете пакет ansible. Она не включена в ansible-core. Чтобы проверить установку, выполните ansible-galaxy collection list.
Для её установки используйте: ansible-galaxy collection install community.network.
Чтобы использовать её в книге задач, укажите: community.network.exos_l2_interfaces.
Новое в community.network 0.2.0
Обзор
- Этот модуль предоставляет декларативное управление интерфейсами L2 на устройствах сетей Extreme Networks EXOS.
Псевдонимы: network.exos.exos_l2_interfaces
Параметры
Параметр | Комментарии |
|---|---|
config список / элементы=словарь | Словарь параметров интерфейсов L2 |
|
access словарь |
Команда switchport mode access для конфигурации интерфейса как доступа уровня 2. |
|
vlan целое число |
Конфигурирует заданный VLAN в порту доступа. Используется как идентификатор VLAN доступа. |
|
name строка / обязательный |
Имя интерфейса |
|
trunk словарь |
Команда switchport mode trunk для конфигурации интерфейса как туннеля уровня 2. |
|
native_vlan целое число |
VLAN по умолчанию, который необходимо настроить в порту туннеля. Используется как идентификатор VLAN по умолчанию туннеля. |
|
trunk_allowed_vlans список / элементы=строка |
Список разрешенных VLAN в заданном порту туннеля. Это единственные VLAN, которые будут настроенны на туннеле. |
state строка | Состояние, в котором должна быть оставлена конфигурация Выбор:
|
Примечания
Примечание
- Тестировано на EXOS 30.2.1.8
- Этот модуль работает с подключением
httpapi. См. Опции платформы EXOS
Примеры
# Using deleted
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Delete L2 interface configuration for the given arguments
community.network.exos_l2_interfaces:
config:
- name: '3'
state: deleted
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Delete L2 interface configuration for the given arguments
community.network.exos_l2_interfaces:
state: deleted
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using merged
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# },
# }
# }
# },
# ]
# }
# }
- name: Merge provided configuration with device configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 10
name: '1'
- name: '2'
trunk:
trunk_allowed_vlans: 10
- name: '3'
trunk:
native_vlan: 10
trunk_allowed_vlans: 20
state: merged
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 10,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "trunk-vlans": [10],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "native-vlan": 10,
# "trunk-vlans": [20],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20
# ]
# }
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20
# ]
# }
# }
# }
# },
# ]
# }
# }
# Using overridden
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Overrride device configuration of all L2 interfaces with provided configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 10
name: '2'
state: overridden
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 10,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 1,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 1
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 10
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": {
# "vlan": 1
# },
# "name": "3",
# "trunk": null
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 1
# }
# }
# }
# }
# ]
# }
# }
# Using replaced
# Before state:
# -------------
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 10
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 20
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 1,
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# }
# ]
# }
# }
- name: Replace device configuration of listed L2 interfaces with provided configuration
community.network.exos_l2_interfaces:
config:
- access:
vlan: 20
name: '1'
- name: '2'
trunk:
trunk_allowed_vlans: 10
- name: '3'
trunk:
native_vlan: 10
trunk_allowed_vlan: 20,30
state: replaced
# Module Execution Results:
# -------------------------
#
# "before": [
# {
# "access": {
# "vlan": 10
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": {
# "vlan": 20
# },
# "name": "2",
# "trunk": null
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 1,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# }
# ],
#
# "requests": [
# {
# "data": {
# "openconfig-vlan:config": {
# "access-vlan": 20,
# "interface-mode": "ACCESS"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=1/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "trunk-vlans": [10],
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=2/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# },
# {
# "data": {
# "openconfig-vlan:config": {
# "native-vlan": 10,
# "trunk-vlans": [20, 30]
# "interface-mode": "TRUNK"
# }
# }
# "method": "PATCH",
# "path": "rest/restconf/data/openconfig-interfaces:interfaces/interface=3/openconfig-if-ethernet:ethernet/openconfig-vlan:switched-vlan/config"
# }
# ],
#
# "after": [
# {
# "access": {
# "vlan": 20
# },
# "name": "1",
# "trunk": null
# },
# {
# "access": null,
# "name": "2",
# "trunk": {
# "native_vlan": null,
# "trunk_allowed_vlans": [
# 10
# ]
# }
# },
# {
# "access": null,
# "name": "3",
# "trunk": {
# "native_vlan": 10,
# "trunk_allowed_vlans": [
# 20,
# 30
# ]
# }
# }
# ]
#
# After state:
# -------------
#
# path: /rest/restconf/data/openconfig-interfaces:interfaces/
# method: GET
# data:
# {
# "openconfig-interfaces:interfaces": {
# "interface": [
# {
# "name": "1",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "ACCESS",
# "access-vlan": 20
# }
# }
# }
# },
# {
# "name": "2",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "trunk-vlans": [
# 10
# ]
# }
# }
# }
# },
# {
# "name": "3",
# "openconfig-if-ethernet:ethernet": {
# "openconfig-vlan:switched-vlan": {
# "config": {
# "interface-mode": "TRUNK",
# "native-vlan": 10,
# "trunk-vlans": [
# 20,
# 30
# ]
# }
# }
# }
# }
# ]
# }
# }
Возвращаемые значения
Общие возвращаемые значения описаны здесь, следующие поля уникальны для этого модуля:
Ключ | Описание |
|---|---|
after список / элементы=строка | Результат вызова модели конфигурации. Возвращается: при изменении Пример: |
before список / элементы=строка | Конфигурация до вызова модели. Возвращается: всегда Пример: |
requests список / элементы=строка | Набор запросов, отправленных на удаленное устройство. Возвращается: всегда Пример: |
Ссылки на коллекцию
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/exos_l2_interfaces_module.html