Spec-Zone.ru › Ansible

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

Примечание

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

Возможно, эта коллекция уже установлена, если вы используете пакет 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

list / elements=dictionary

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

members

list / elements=dictionary

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

member

string

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

mode

string

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

Варианты:

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

name

string / обязательный

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

running_config

string

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

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

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

state

string

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

Варианты:

  • "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

list / elements=string

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

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

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

before

list / elements=string

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

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

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

commands

list / elements=string

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

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

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

Авторы

  • Nathaniel Case (@Qalthos)

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

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

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/arista/eos/eos_lag_interfaces_module.html

Spec-Zone.ru

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