Spec-Zone.ru › Ansible 2.11

cisco.iosxr.iosxr_lacp_interfaces – Модуль ресурсов интерфейсов LACP

Примечание

Этот плагин входит в коллекцию cisco.iosxr (версия 1.2.1).

Для его установки используйте: ansible-galaxy collection install cisco.iosxr.

Для использования в книге задач укажите: cisco.iosxr.iosxr_lacp_interfaces.

Новое в версии 1.0.0: модуля cisco.iosxr

  • Обзор
  • Параметры
  • Примечания
  • Примеры
  • Возвращаемые значения

Обзор

  • Этот модуль управляет атрибутами протокола Link Aggregation Control Protocol (LACP) интерфейсов на устройствах IOS-XR.

Примечание

Для этого модуля существует соответствующий плагин действий.

Параметры

Параметр Варианты/Значения по умолчанию Комментарии
config
список / элементы=словарь
Словарь параметров интерфейсов LACP.
churn_logging
строка
    Варианты:
  • actor
  • partner
  • both
Указывает параметр для ведения журнала событий колебаний LACP.
Доступен только для ether-bundle.
Режим 'actor' регистрирует только события колебаний actor.
Режим 'partner' регистрирует только события колебаний partner.
Режим 'both' регистрирует события колебаний actor и partner.
collector_max_delay
целое число
Указывает максимальную задержку коллектора, которая должна быть сигнализирована партнеру LACP.
Доступен только для ether-bundle.
См. документацию производителя для допустимых значений.
name
строка
Имя/Идентификатор интерфейса или ether-bundle.
period
целое число
Указывает скорость отправки или получения пакетов.
Для ether-bundle это указывает период, который будет использоваться его связующими ссылками.
См. документацию производителя для допустимых значений.
switchover_suppress_flaps
целое число
Указывает время, в течение которого следует подавлять флэпы во время переключения LACP.
Доступен только для ether-bundle.
См. документацию производителя для допустимых значений.
system
словарь
Этот объект словаря содержит настраиваемые параметры, относящиеся к системным параметрам LACP для ether-bundle.
mac
строка
Указывает системный идентификатор для использования в переговорах LACP для пакета, закодированный как MAC-адрес.
priority
целое число
Указывает приоритет системы для использования в переговорах LACP для пакета.
См. документацию производителя для допустимых значений.
running_config
строка
Этот параметр используется только со значением состояния parsed.
Значение этого параметра должно быть результатом выполнения команды show running-config int на устройстве IOS-XR.
Состояние parsed считывает конфигурацию из параметра running_config, преобразует её в структурированные данные Ansible в соответствии с argspec модуля ресурсов и возвращает значение в ключе parsed в результате.
state
строка
    Варианты:
  • merged ←
  • replaced
  • overridden
  • deleted
  • parsed
  • gathered
  • rendered
Состояние конфигурации после завершения работы модуля.

Примечания

Примечание

  • Тестировалось на IOS-XR 6.1.3.
  • Этот модуль работает с подключением network_cli. См. параметры платформы IOS-XR.

Примеры

# Using merged
#
#
# ------------
# Before state
# ------------
#
#
#
# RP/0/0/CPU0:an-iosxr#sh running-config interface
# Sun Jul 21 18:01:35.079 UTC
# interface Bundle-Ether10
# !
# interface Bundle-Ether11
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1'
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#
#

- name: Merge provided configuration with device configuration
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    - name: Bundle-Ether10
      churn_logging: actor
      collector_max_delay: 100
      switchover_suppress_flaps: 500

    - name: Bundle-Ether11
      system:
        mac: 00c2.4c00.bd15

    - name: GigabitEthernet0/0/0/1
      period: 200
    state: merged

#
#
# -----------
# After state
# -----------
#
#
# RP/0/0/CPU0:an-iosxr#sh run int
# Sun Jul 21 18:24:52.413 UTC
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#


# Using replaced
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:an-iosxr#sh run int
# Sun Jul 21 18:24:52.413 UTC
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#

- name: Replace LACP configuration of listed interfaces with provided configuration
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    - name: Bundle-Ether10
      churn_logging: partner

    - name: GigabitEthernet0/0/0/2
      period: 300
    state: replaced

#
#
# -----------
# After state
# -----------
#
#
# RP/0/0/CPU0:an-iosxr#sh run int
# Sun Jul 21 18:50:21.929 UTC
# interface Bundle-Ether10
#  lacp churn logging partner
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
#  lacp period 300
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#
#


# Using overridden
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:an-iosxr#sh run int
# Sun Jul 21 18:24:52.413 UTC
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#
#

- name: Override all interface LACP configuration with provided configuration
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    - name: Bundle-Ether12
      churn_logging: both
      collector_max_delay: 100
      switchover_suppress_flaps: 500

    - name: GigabitEthernet0/0/0/1
      period: 300
    state: overridden

#
#
# -----------
# After state
# -----------
#
#
# RP/0/0/CPU0:an-iosxr(config-if)#do sh run int
# Sun Jul 21 19:32:36.115 UTC
# interface Bundle-Ether10
# !
# interface Bundle-Ether11
# !
# interface Bundle-Ether12
#  lacp churn logging both
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 300
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#


# Using deleted
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/0/CPU0:an-iosxr#sh run int
# Sun Jul 21 18:24:52.413 UTC
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp non-revertive
# !
# interface Bundle-Ether12
# !
# interface Loopback888
#  description test for ansible
#  shutdown
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  description 'GigabitEthernet - 1"
#  lacp period 200
# !
# interface GigabitEthernet0/0/0/2
#  description "GigabitEthernet - 2"
#   lacp period 300
# !
# interface GigabitEthernet0/0/0/3
#  description "GigabitEthernet - 3"
# !
# interface GigabitEthernet0/0/0/4
#  description "GigabitEthernet - 4"
# !
#

- name: Deleted LACP configurations of provided interfaces (Note - This won't delete
    the interface itself)
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    - name: Bundle-Ether10
    - name: Bundle-Ether11
    - name: GigabitEthernet0/0/0/1
    - name: GigabitEthernet0/0/0/2
    state: deleted

#
#
# -----------
# After state
# -----------
#
#
# Using parsed:

# parsed.cfg
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  lacp period 200
# !
#

- name: Convert lacp interfaces config to argspec without connecting to the appliance
  cisco.iosxr.iosxr_lacp_interfaces:
    running_config: "{{ lookup('file', './parsed.cfg') }}"
    state: parsed

# --------------
# Output:
# --------------

#    parsed:
#      - name: Bundle-Ether10
#        churn_logging: actor
#        collector_max_delay: 100
#        switchover_suppress_flaps: 500
#
#      - name: Bundle-Ether11
#        system:
#          mac: 00c2.4c00.bd15
#
#      - name: GigabitEthernet0/0/0/1
#        period: 200
#
#

# Using gathered:

# Native config:
# interface Bundle-Ether10
#  lacp churn logging actor
#  lacp switchover suppress-flaps 500
#  lacp collector-max-delay 100
# !
# interface Bundle-Ether11
#  lacp system mac 00c2.4c00.bd15
# !
# interface MgmtEth0/0/CPU0/0
#  ipv4 address 192.0.2.11 255.255.255.0
# !
# interface GigabitEthernet0/0/0/1
#  lacp period 200
# !
#

- name: Gather IOSXR lacp interfaces configuration
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    state: gathered

# ----------
# Output
# ---------
#    gathered:
#      - name: Bundle-Ether10
#        churn_logging: actor
#        collector_max_delay: 100
#        switchover_suppress_flaps: 500
#
#      - name: Bundle-Ether11
#        system:
#          mac: 00c2.4c00.bd15
#
#      - name: GigabitEthernet0/0/0/1
#        period: 200

# Using rendered:

- name: Render platform specific commands from task input using rendered state
  cisco.iosxr.iosxr_lacp_interfaces:
    config:
    - name: Bundle-Ether10
      churn_logging: actor
      collector_max_delay: 100
      switchover_suppress_flaps: 500

    - name: Bundle-Ether11
      system:
        mac: 00c2.4c00.bd15

    - name: GigabitEthernet0/0/0/1
      period: 200
    state: rendered

# -------------
# Output
# -------------
# rendered: [
#     - "interface Bundle-Ether10"
#     - " lacp churn logging actor"
#     - " lacp switchover suppress-flaps 500"
#     - " lacp collector-max-delay 100"
#     - "interface Bundle-Ether11"
#     - " lacp system mac 00c2.4c00.bd15"
#     - "interface MgmtEth0/0/CPU0/0"
#     - " ipv4 address 192.0.2.11 255.255.255.0"
#     - "interface GigabitEthernet0/0/0/1"
#     - " lacp period 200"
#

Возвращаемые значения

Общие возвращаемые значения описаны здесь, следующие поля уникальны для этого модуля:

Ключ Возвращаемое Описание
after
список / элементы=строка
при изменении
Конфигурация в структурированном формате после завершения работы модуля.

Пример:
Возвращаемая конфигурация всегда будет в том же формате, что и параметры выше.
before
список / элементы=строка
всегда
Конфигурация в структурированном формате до вызова модуля.

Пример:
Возвращаемая конфигурация всегда будет в том же формате, что и параметры выше.
commands
список / элементы=строка
всегда
Набор команд, отправленных на удаленное устройство.

Пример:
['interface Bundle-Ether10', 'lacp churn logging partner', 'lacp period 150']


Авторы

  • Nilashish Chakraborty (@nilashishc)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/cisco/iosxr/iosxr_lacp_interfaces_module.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API