Spec-Zone.ru › Ansible

arista.eos.eos_lag_interfaces модуль — ресурс LAG интерфейсов

Примечание

Этот модуль входит в коллекцию arista.eos (версия 9.0.0).

Возможно, эта коллекция уже установлена, если вы используете пакет ansible. Она не входит в ansible-core. Чтобы проверить установку, выполните ansible-galaxy collection list.

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

Для использования в книге задач укажите: arista.eos.eos_lag_interfaces.

Добавлен в arista.eos 1.0.0

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

Обзор

  • Этот модуль управляет атрибутами групп агрегирования каналов на устройствах Arista EOS.

Псевдонимы: lag_interfaces

Параметры

Параметр

Комментарии

config

список / элементы=словарь

Список конфигураций групп агрегирования каналов.

members

список / элементы=словарь

Интерфейсы Ethernet, входящие в группу.

member

строка

Имя интерфейса Ethernet, являющегося членом LAG.

mode

строка

Режим LAG для этого интерфейса.

Варианты:

  • "active"
  • "on"
  • "passive"

name

строка / обязательно

Имя интерфейса канала агрегирования (LAG), например, Port-Channel5.

running_config

строка

Этот параметр используется только со значением parsed.

Значение этого параметра должно быть результатом выполнения команды show running-config | section interfaces на устройстве EOS.

Состояние parsed считывает конфигурацию из параметра running_config и преобразует её в структурированные данные Ansible, соответствующие argspec модуля ресурса. Затем значение возвращается в поле parsed результата.

state

строка

Состояние конфигурации после завершения модуля.

Варианты:

  • "merged" ← (по умолчанию)
  • "replaced"
  • "overridden"
  • "deleted"
  • "rendered"
  • "gathered"
  • "parsed"

Примечания

Примечание

  • Проверено на Arista EOS 4.24.6F
  • Этот модуль работает с подключением network_cli. Смотрите варианты платформы EOS.

Примеры

# Using merged

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2

- name: Merge provided LAG attributes with existing device configuration
  arista.eos.eos_lag_interfaces:
    config:
      - name: Port-Channel5
        members:
          - member: Ethernet2
            mode: "on"
    state: merged

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2
#   channel-group 5 mode on


# Using replaced

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2

- name: Replace all device configuration of specified LAGs with provided configuration
  arista.eos.eos_lag_interfaces:
    config:
      - name: Port-Channel5
        members:
          - member: Ethernet2
            mode: "on"
    state: replaced

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# interface Ethernet2
#   channel-group 5 mode on


# Using overridden

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2

- name: Override all device configuration of all LAG attributes with provided configuration
  arista.eos.eos_lag_interfaces:
    config:
      - name: Port-Channel10
        members:
          - member: Ethernet2
            mode: "on"
    state: overridden

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# interface Ethernet2
#   channel-group 10 mode on


# Using deleted

# Before state:
# -------------
#
# veos#show running-config | section interface
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2
#   channel-group 5 mode on

- name: Delete LAG attributes of the given interfaces.
  arista.eos.eos_lag_interfaces:
    config:
      - name: Port-Channel5
        members:
          - member: Ethernet1
    state: deleted

# After state:
# ------------
#
# veos#show running-config | section interface
# interface Ethernet1
# interface Ethernet2
#   channel-group 5 mode on

# Using parsed:

# parsed.cfg
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2
#   channel-group 5 mode on

- name: Use parsed to convert native configs to structured data
  arista.eos.lag_interfaces:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Output:
#   parsed:
#     - name: Port-Channel5
#       members:
#         - member: Ethernet2
#           mode: "on"
#         - member: Ethernet1
#           mode: "on"

# using rendered:

- name: Use Rendered to convert the structured data to native config
  arista.eos.eos_lag_interfaces:
    config:
      - name: Port-Channel5
        members:
          - member: Ethernet2
            mode: "on"
          - member: Ethernet1
            mode: "on"
    state: rendered
# -----------
# Output
# -----------
#
# rendered:

# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2
#   channel-group 5 mode on


# Using gathered:

# native config:
# interface Ethernet1
#   channel-group 5 mode on
# interface Ethernet2
#   channel-group 5 mode on

- name: Gather lldp_global facts from the device
  arista.eos.lldp_global:
    state: gathered

# Output:
#   gathered:
#     - name: Port-Channel5
#       members:
#         - member: Ethernet2
#           mode: on
#         - member: Ethernet1
#           mode: on

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

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

Ключ

Описание

after

список / элементы=строка

Конфигурация в виде структурированных данных после завершения модуля.

Возвращается: при изменении

Пример: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

before

список / элементы=строка

Конфигурация в виде структурированных данных до вызова модуля.

Возвращается: всегда

Пример: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

commands

список / элементы=строка

Набор команд, отправленных на удалённое устройство.

Возвращается: всегда

Пример: ["command 1", "command 2", "command 3"]

Авторы

  • Nathaniel Case (@Qalthos)

Ссылки на коллекцию

  • Система отслеживания задач
  • Репозиторий (исходные коды)

© 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/arista/eos/eos_lag_interfaces_module.html

Spec-Zone.ru

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