Spec-Zone.ru › Ansible 2.9

iosxr_lldp_interfaces – Управление атрибутами протокола Link Layer Discovery Protocol (LLDP) интерфейсов на устройствах IOS-XR

Новое в версии 2.9.

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

Обзор

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

Параметры

Параметр Варианты/Значения по умолчанию Комментарии
config
список / элементы=словарь
Словарь опций интерфейсов LLDP.
destination
словарь
Указывает конфигурацию назначения LLDP на интерфейсе.
mac_address
строка
    Варианты:
  • ieee-nearest-bridge
  • ieee-nearest-non-tmpr-bridge
Указывает MAC-адрес назначения LLDP на интерфейсе.
name
строка
Имя/идентификатор интерфейса или Ether-Bundle.
receive
булево
    Варианты:
  • no
  • yes
Включить/выключить прием LLDP на интерфейсе.
transmit
булево
    Варианты:
  • no
  • yes
Включить/выключить передачу LLDP по интерфейсу.
state
строка
    Варианты:
  • merged ←
  • replaced
  • overridden
  • deleted
Состояние конфигурации после завершения модуля.

Примечания

Примечание

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

Примеры

# Using merged
#
#
# ------------
# Before state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:40:23.104 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#

- name: Merge provided configuration with running configuration
  iosxr_lldp_interfaces:
    config:
      - name: GigabitEthernet0/0/0/1
        destination:
          mac_address: ieee-nearest-non-tmpr-bridge
        transmit: False

      - name: GigabitEthernet0/0/0/2
        destination:
          mac_address: ieee-nearest-bridge
        receive: False
    state: merged

#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "name": "GigabitEthernet0/0/0/1"
#        },
#        {
#            "name": "GigabitEthernet0/0/0/2"
#        }
# ]
#
# "commands": [
#        "interface GigabitEthernet0/0/0/2",
#        "lldp destination mac-address ieee-nearest-non-tmpr-bridge",
#        "lldp transmit disable",
#        "interface GigabitEthernet0/0/0/1",
#        "lldp receive disable",
#        "lldp destination mac-address ieee-nearest-bridge"
# ]
#
# "after": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/1",
#            "receive": false
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/2",
#            "transmit": false
#        }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:49:51.517 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   receive disable
#   destination mac-address
#    ieee-nearest-bridge
#   !
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
#  lldp
#   transmit disable
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
#
#


# Using replaced
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 12:49:51.517 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   receive disable
#   destination mac-address
#    ieee-nearest-bridge
#   !
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
#  lldp
#   transmit disable
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
#
#

- name: Replace existing LLDP configurations of specified interfaces with provided configuration
  iosxr_lldp_interfaces:
    config:
      - name: GigabitEthernet0/0/0/1
        destination:
          mac_address: ieee-nearest-non-tmpr-bridge
    state: replaced

#
#
# ------------------------
# Module Execution Result
# ------------------------
#
# "before": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/1",
#            "receive": false
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/2",
#            "transmit": false
#        }
# ]
#
#
# "commands": [
#        "interface GigabitEthernet0/0/0/1",
#        "no lldp receive disable",
#        "lldp destination mac-address ieee-nearest-non-tmpr-bridge"
# ]
#
#
# "after": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/1"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/2",
#            "transmit": false
#        }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:02:57.062 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
#  lldp
#   transmit disable
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
#
#


# Using overridden
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:15:40.465 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   receive disable
#   destination mac-address
#    ieee-nearest-bridge
#   !
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
#  lldp
#   transmit disable
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
#
#

- name: Override the LLDP configurations of all the interfaces with provided configurations
  iosxr_lldp_interfaces:
    config:
      - name: GigabitEthernet0/0/0/1
        transmit: False
    state: overridden

#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/1",
#            "receive": false
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/2",
#            "transmit": false
#        }
# ]
#
# "commands": [
#        "interface GigabitEthernet0/0/0/2",
#        "no lldp destination mac-address ieee-nearest-non-tmpr-bridge",
#        "no lldp transmit disable",
#        "interface GigabitEthernet0/0/0/1",
#        "no lldp destination mac-address ieee-nearest-bridge",
#        "no lldp receive disable",
#        "lldp transmit disable"
# ]
#
#
# "after": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "name": "GigabitEthernet0/0/0/1",
#            "transmit": false
#        },
#        {
#            "name": "GigabitEthernet0/0/0/2"
#        }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:22:25.604 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   transmit disable
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#


# Using deleted
#
#
# -------------
# Before state
# -------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:26:21.498 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
#  lldp
#   receive disable
#   destination mac-address
#    ieee-nearest-bridge
#   !
#  !
# !
# interface preconfigure GigabitEthernet0/0/0/2
#  lldp
#   transmit disable
#   destination mac-address
#    ieee-nearest-non-tmpr-bridge
#   !
#  !
# !
#
#

- name: Delete LLDP configurations of all interfaces (Note - This won't delete the interfaces themselves)
  iosxr_lldp_interfaces:
    state: deleted

#
#
#
# ------------------------
# Module Execution Result
# ------------------------
#
#
# "before": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/1",
#            "receive": false
#        },
#        {
#            "destination": {
#                "mac_address": "ieee-nearest-non-tmpr-bridge"
#            },
#            "name": "GigabitEthernet0/0/0/2",
#            "transmit": false
#        }
# ]
#
#
# "commands": [
#        "interface GigabitEthernet0/0/0/1",
#        "no lldp destination mac-address ieee-nearest-bridge",
#        "no lldp receive disable",
#        "interface GigabitEthernet0/0/0/2",
#        "no lldp destination mac-address ieee-nearest-non-tmpr-bridge",
#        "no lldp transmit disable"
# ]
#
#
# "after": [
#        {
#            "name": "TenGigE0/0/0/0"
#        },
#        {
#            "name": "GigabitEthernet0/0/0/1"
#        },
#        {
#            "name": "GigabitEthernet0/0/0/2"
#        }
# ]
#
#
# ------------
# After state
# ------------
#
#
# RP/0/RP0/CPU0:ios#sh run int
# Mon Aug 12 13:30:14.618 UTC
# interface TenGigE0/0/0/0
#  ipv4 address 192.0.2.11 255.255.255.192
# !
# interface preconfigure GigabitEthernet0/0/0/1
# !
# interface preconfigure GigabitEthernet0/0/0/2
# !
#
#

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

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

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

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

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

Пример:
['interface GigabitEthernet0/0/0/1', 'lldp destination mac-address ieee-nearest-non-tmpr-bridge', 'no lldp transmit disable']


Статус

  • Этот модуль не гарантирует обратной совместимости интерфейса. [превью]
  • Этот модуль поддерживается командой Ansible Network. [network]

Поддержка Red Hat

Дополнительную информацию о поддержке этого модуля Red Hat можно найти в этой статье базы знаний Red Hat.

Авторы

  • Nilashish Chakraborty (@nilashishc)

Подсказка

Если вы заметите какие-либо проблемы в этой документации, вы можете отредактировать этот документ, чтобы улучшить его.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/iosxr_lldp_interfaces_module.html

Spec-Zone.ru

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