Модуль cisco.ios.ios_lacp_interfaces — Модуль ресурсов для настройки интерфейсов LACP.
Примечание
Этот модуль входит в коллекцию cisco.ios (версия 8.0.0).
Возможно, эта коллекция уже установлена, если вы используете пакет ansible. Она не включена в ansible-core. Чтобы проверить установку, выполните ansible-galaxy collection list.
Для установки используйте: ansible-galaxy collection install cisco.ios.
Чтобы использовать его в книге задач, укажите: cisco.ios.ios_lacp_interfaces.
Добавлена в cisco.ios 1.0.0
Обзор
- Этот модуль обеспечивает декларативное управление LACP на сетевых устройствах Cisco IOS lacp_interfaces.
Псевдонимы: lacp_interfaces
Параметры
Параметр | Комментарии |
|---|---|
config список / элементы=словарь | Словарь параметров LACP lacp_interfaces |
|
fast_switchover булево |
Поддержка LACP быстрого переключения на этом канале портов. Варианты:
|
|
max_bundle целое число |
Максимальное количество портов LACP для объединения в этом канале портов. Обратитесь к документации производителя для допустимых значений портов. |
|
name строка / обязательный |
Имя интерфейса для настройки LACP. |
|
port_priority целое число |
Приоритет LACP на этом интерфейсе. Обратитесь к документации производителя для допустимых значений портов. |
running_config строка | Этот параметр используется только со состоянием parsed. Значение этого параметра должно соответствовать выводу устройства IOS после выполнения команды show running-config | section ^interface. Состояние parsed считывает конфигурацию из параметра |
state строка | Состояние, в котором должна быть оставлена конфигурация Состояния rendered, gathered и parsed не выполняют никаких изменений на устройстве. Состояние rendered преобразует конфигурацию в Состояние gathered извлечёт текущую конфигурацию с устройства и преобразует её в структурированные данные в формате, соответствующем спецификации аргументов модуля ресурсов, а значение возвращается в ключе gathered результата. Состояние parsed считывает конфигурацию из параметра Варианты:
|
Примечания
Примечание
- Тестировано на Cisco IOSXE версии 17.3 на CML.
- Этот модуль работает с подключением
network_cli. См. https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html
Примеры
# Using merged
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
- name: Merge provided configuration with device configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 10
- name: GigabitEthernet0/2
port_priority: 20
- name: GigabitEthernet0/3
port_priority: 30
- name: Port-channel10
fast_switchover: true
max_bundle: 5
state: merged
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 5
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
# Using overridden
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: Override device configuration of all lacp_interfaces with provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 20
- name: Port-channel10
max_bundle: 2
state: overridden
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp max-bundle 2
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# Using replaced
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp max-bundle 5
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: Replaces device configuration of listed lacp_interfaces with provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/3
port_priority: 40
- name: Port-channel10
fast_switchover: true
max_bundle: 2
state: replaced
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 40
# Using Deleted
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# flowcontrol receive on
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: "Delete LACP attributes of given interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
# Using Deleted without any config passed
# "(NOTE: This will delete all of configured LLDP module attributes)"
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# interface Port-channel20
# lacp max-bundle 2
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: "Delete LACP attributes for all configured interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lacp_interfaces:
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel40
# lacp max-bundle 5
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# lacp port-priority 30
# interface GigabitEthernet0/2
# lacp port-priority 20
- name: Gather listed LACP interfaces with provided configurations
cisco.ios.ios_lacp_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "fast_switchover": true,
# "max_bundle": 2,
# "name": "Port-channel10"
# },
# {
# "max_bundle": 5,
# "name": "Port-channel40"
# },
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1",
# "port_priority": 30
# },
# {
# "name": "GigabitEthernet0/2",
# "port_priority": 20
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel40
# lacp max-bundle 5
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# lacp port-priority 30
# interface GigabitEthernet0/2
# lacp port-priority 20
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 10
- name: GigabitEthernet0/2
port_priority: 20
- name: Port-channel10
fast_switchover: true
max_bundle: 2
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "lacp port-priority 10",
# "interface GigabitEthernet0/2",
# "lacp port-priority 20",
# "interface Port-channel10",
# "lacp max-bundle 2",
# "lacp fast-switchover"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# lacp port-priority 10
# interface GigabitEthernet0/2
# lacp port-priority 20
# interface Port-channel10
# lacp max-bundle 2 fast-switchover
- name: Parse the commands for provided configuration
cisco.ios.ios_lacp_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "name": "GigabitEthernet0/1",
# "port_priority": 10
# },
# {
# "name": "GigabitEthernet0/2",
# "port_priority": 20
# },
# {
# "fast_switchover": true,
# "max_bundle": 2,
# "name": "Port-channel10"
# }
# ]
Возвращаемые значения
Общие возвращаемые значения описаны здесь, следующие поля уникальны для этого модуля:
Ключ | Описание |
|---|---|
after список / элементы=строка | Конфигурация в виде структурированных данных после выполнения модуля. Возвращается: при изменении Пример: |
before список / элементы=строка | Конфигурация в виде структурированных данных до запуска модуля. Возвращается: всегда Пример: |
commands список / элементы=строка | Набор команд, отправленных на удаленное устройство. Возвращается: всегда Пример: |
Ссылки на коллекцию
© 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/cisco/ios/ios_lacp_interfaces_module.html