Spec-Zone.ru › Ansible

Модуль arista.eos.eos_lldp_interfaces – модуль ресурсов интерфейсов LLDP

Примечание

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

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

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

Чтобы использовать её в плейбуке, укажите: arista.eos.eos_lldp_interfaces.

Новое в arista.eos 1.0.0

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

Обзор

  • Этот модуль управляет атрибутами протокола Link Layer Discovery Protocol (LLDP) интерфейсов на устройствах Arista EOS.

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

Параметры

Параметр

Комментарии

config

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

Словарь параметров интерфейсов LLDP.

name

строка

Полное имя интерфейса (например, Ethernet1).

receive

логическое значение

Включение/отключение приема LLDP на интерфейсе.

Варианты:

  • false
  • true

transmit

логическое значение

Включение/выключение передачи LLDP по интерфейсу.

Варианты:

  • false
  • true

running_config

строка

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

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

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

state

строка

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

Варианты:

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

Примечания

Примечание

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

Примеры

# Using merged
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp receive
# interface Ethernet2
#    no lldp transmit

- name: Merge provided configuration with running configuration
  arista.eos.eos_lldp_interfaces:
    config:
      - name: Ethernet1
        transmit: false
      - name: Ethernet2
        transmit: false
    state: merged

#
# ------------
# After state
# ------------
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp transmit
#    no lldp receive
# interface Ethernet2
#    no lldp transmit


# Using replaced
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp receive
# interface Ethernet2
#    no lldp transmit

- name: Replace existing LLDP configuration of specified interfaces with provided
    configuration
  arista.eos.eos_lldp_interfaces:
    config:
      - name: Ethernet1
        transmit: false
    state: replaced

#
# ------------
# After state
# ------------
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp transmit
# interface Ethernet2
#    no lldp transmit


# Using overridden
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp receive
# interface Ethernet2
#    no lldp transmit

- name: Override the LLDP configuration of all the interfaces with provided configuration
  arista.eos.eos_lldp_interfaces:
    config:
      - name: Ethernet1
        transmit: false
    state: overridden

#
# ------------
# After state
# ------------
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp transmit
# interface Ethernet2


# Using deleted
#
#
# ------------
# Before state
# ------------
#
#
# veos#show run | section ^interface
# interface Ethernet1
#    no lldp receive
# interface Ethernet2
#    no lldp transmit

- name: Delete LLDP configuration of specified interfaces (or all interfaces if none
    are specified)
  arista.eos.eos_lldp_interfaces:
    state: deleted

#
# ------------
# After state
# ------------
#
# veos#show run | section ^interface
# interface Ethernet1
# interface Ethernet2

# using rendered:

- name: Use Rendered to convert the structured data to native config
  arista.eos.eos_lldp_interfaces:
    config:
      - name: Ethernet1
        transmit: false
      - name: Ethernet2
        transmit: false
    state: rendered

#
# ------------
# Output
# ------------
#
# interface Ethernet1
#    no lldp transmit
# interface Ethernet2
#    no lldp transmit

# Using parsed
# parsed.cfg

# interface Ethernet1
#    no lldp transmit
# interface Ethernet2
#    no lldp transmit


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

# ------------
# Output
# ------------

#   parsed:
#     - name: Ethernet1
#       transmit: False
#     - name: Ethernet2
#       transmit: False

# Using gathered:

# native config:
# interface Ethernet1
#    no lldp transmit
# interface Ethernet2
#    no lldp transmit

- name: Gather lldp interfaces facts from the device
  arista.eos.lldp_interfaces:
    state: gathered

# ------------
# Output
# ------------

#   gathered:
#     - name: Ethernet1
#       transmit: False
#     - name: Ethernet2
#       transmit: False

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

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

Ключ

Описание

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

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

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

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

Пример: ["interface Ethernet1", "no lldp transmit"]

Авторы

  • 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_lldp_interfaces_module.html

Spec-Zone.ru

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