Spec-Zone.ru › Ansible

Модуль dellemc.enterprise_sonic.sonic_ospfv2_interfaces — настройка параметров протокола OSPFv2 в режиме интерфейса на SONiC.

Примечание

Этот модуль входит в коллекцию dellemc.enterprise_sonic (версия 3.2.0).

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

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

Чтобы использовать коллекцию в плейбуке, укажите: dellemc.enterprise_sonic.sonic_ospfv2_interfaces.

Добавлено в dellemc.enterprise_sonic 2.5.0

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

Обзор

  • Этот модуль позволяет управлять конфигурацией параметров OSPFv2 в режиме интерфейса на устройствах под управлением SONiC.
  • Перед настройкой OSPF в VRF настройте экземпляр VRF.
  • Перед настройкой OSPF на интерфейсах настройте экземпляр OSPF.

Параметры

Параметр

Комментарии

config

list / elements=dictionary

Задает конфигурацию интерфейсов OSPFv2.

bfd

dictionary

Настраивает BFD для интерфейса OSPFv2.

bfd_profile

string

Настраивает профиль BFD.

enable

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

Включает поддержку BFD для OSPFv2.

Варианты:

  • false
  • true

name

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

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

network

string

Настраивает тип сети интерфейса OSPFv2

Варианты:

  • "broadcast"
  • "point_to_point"

ospf_attributes

list / elements=dictionary

Задает конфигурацию OSPFv2 для интерфейса.

Если параметр address не указан, используется IPv4-адрес интерфейса.

Параметры dead_interval и hello_multiplier являются взаимоисключающими.

address

string

Задает IPv4-адрес интерфейса.

area_id

string

Идентификатор области OSPFv2 сети (A.B.C.D или от 0 до 4294967295).

authentication

dictionary

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

Ключ аутентификации должен содержать не более 8 символов.

encrypted

boolean

Указывает, зашифрован ли пароль.

Варианты:

  • false
  • true

password

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

Задает пароль аутентификации.

Пароль в открытом текстовом формате, то есть пароль с параметром encrypted=false, будет сохранен в зашифрованном формате в running-config. Поэтому идемпотентность не будет обеспечена, и задача всегда будет возвращать changed=true.

authentication_type

string

Включает аутентификацию OSPFv2 и задает ее тип.

MD5HMAC — включает тип аутентификации с дайджестом сообщения.

NONE — включает аутентификацию без проверки.

TEXT — включает аутентификацию в открытом текстовом формате.

Варианты:

  • "MD5HMAC"
  • "NONE"
  • "TEXT"

cost

integer

Настраивает стоимость интерфейса OSPFv2 (от 1 до 65535).

dead_interval

integer

Настраивает интервал ожидания соседства OSPFv2 (от 1 до 65535).

hello_interval

integer

Настраивает интервал отправки hello-пакетов соседу OSPFv2 (от 1 до 65535).

hello_multiplier

integer

Минимальный интервал ожидания — 1 с, при этом hello-пакеты отправляются с субсекундным интервалом.

Количество hello-пакетов, отправляемых каждую секунду (от 1 до 10).

md_authentication

list / elements=dictionary

Настраивает ключи и пароль дайджеста сообщения OSPFv2.

Используется алгоритм MD5.

encrypted

boolean

Указывает, зашифрован ли пароль.

Варианты:

  • false
  • true

key_id

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

Задает идентификатор ключа дайджеста сообщения OSPFv2 (от 1 до 255).

md5key

string

Задает пароль дайджеста сообщения OSPFv2.

Пароль в открытом текстовом формате, то есть пароль с параметром encrypted=false, будет сохранен в зашифрованном формате в running-config. Поэтому идемпотентность не будет обеспечена, и задача всегда будет возвращать changed=true.

mtu_ignore

boolean

Отключает обнаружение несоответствия MTU для OSPFv2.

Варианты:

  • false
  • true

priority

integer

Настраивает приоритет маршрутизатора в соседстве OSPFv2 (от 0 до 255).

retransmit_interval

integer

Настраивает интервал повторной передачи OSPFv2 (от 2 до 65535).

transmit_delay

integer

Настраивает задержку передачи OSPFv2 (от 1 до 65535).

state

string

Задает операцию, выполняемую с настроенными на устройстве интерфейсами OSPFv2.

При значении merged входная конфигурация объединяется с существующей конфигурацией интерфейсов OSPFv2 на устройстве.

При значении deleted существующая конфигурация интерфейсов OSPFv2 удаляется с устройства.

При значении overridden вся существующая конфигурация интерфейсов OSPFv2 удаляется, после чего устанавливается указанная входная конфигурация.

При значении replaced существующая конфигурация интерфейса OSPFv2 на устройстве заменяется конфигурацией из плейбука для каждой настроенной в плейбуке группы интерфейсов.

Варианты:

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

Примечания

Примечание

  • Поддерживается check_mode.

Примеры

# Using "deleted" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
# !
# interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#

- name: Delete the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/1'
        ospf_attributes:
          - area_id: '2.2.2.2'
            cost: 30
            priority: 20
            hello_interval: 10
            dead_interval: 40
            mtu_ignore: true
          - address: '10.10.120.1'
            authentication_type: 'NONE'
            authentication:
              password: 'pass2'
          - address: '10.19.119.1'
        bfd:
          enable: true
          bfd_profile: 'profile2'
        network: point_to_point
      - name: 'Eth1/2'
        bfd:
          enable: true
      - name: 'Eth1/3'
    state: deleted

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# ip ospf network point-to-point
# !
# interface Eth1/3
# !
# sonic#


# Using "deleted" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
# !
# interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#

- name: Delete the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/1'
      - name: 'Eth1/2'
        bfd:
          enable: true
      - name: 'Eth1/3'
    state: deleted

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# !
# interface Eth1/2
# ip ospf network point-to-point
# !
# interface Eth1/3
# !
# sonic#


# Using "merged" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# !
# interface Eth1/2
# !
# interface Eth1/3
# !
# sonic#

- name: Add the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/1'
        ospf_attributes:
          - area_id: '2.2.2.2'
            cost: 20
            priority: 20
            hello_interval: 10
            dead_interval: 40
            mtu_ignore: true
            -address: '10.10.120.1'
            authentication_type: 'MD5HMAC'
            authentication:
              password: 'password'
            hello_multiplier: 5
        bfd:
          enable: true
          bfd_profile: 'profile1'
        network: broadcast
      - name: 'Eth1/3'
        ospf_attributes:
          - area_id: '3.3.3.3'
            address: '10.19.120.2'
            authentication_type: 'MD5HMAC'
            authentication:
              password: 'password'
            hello_multiplier: 5
        bfd:
          enable: true
        network: point_to_point
    state: merged

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#


# Using "merged" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#

- name: Add the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/1'
        ospf_attributes:
          - area_id: '2.2.2.2'
            cost: 30
            priority: 20
            hello_interval: 10
            dead_interval: 40
            mtu_ignore: true
          - address: '10.10.120.1'
            authentication_type: 'NONE'
            authentication:
              password: 'pass2'
          - address: '10.19.119.1'
            authentication_type: 'NONE'
            md_authentication:
              - key_id: 10
                md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                encrypted: true
        bfd:
          enable: true
          bfd_profile: 'profile2'
        network: point_to_point
      - name: 'Eth1/2'
        bfd:
          enable: true
        network: point_to_point
    state: merged

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
# !
# interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#


# Using "replaced" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#

- name: Replace the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/3'
        ospf_attributes:
          - area_id: '2.2.2.2'
            cost: 30
            priority: 20
            hello_interval: 10
            dead_interval: 40
            mtu_ignore: true
          - address: '10.10.120.1'
            authentication_type: 'NONE'
            authentication:
              password: 'pass2'
          - address: '10.19.119.1'
            authentication_type: 'NONE'
            md_authentication:
              - key_id: 10
                md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                encrypted: true
        bfd:
          enable: true
          bfd_profile: 'profile2'
        network: broadcast
    state: replaced

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX186k2R2hUXaDloW8hfkApn5Zx5hCQy9usc= encrypted 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
# !
# sonic#


# Using "overridden" state

# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
# !
# sonic#

- name: Override the OSPFv2_interface configurations
  sonic_ospfv2_interfaces:
    config:
      - name: 'Eth1/3'
        ospf_attributes:
          - area_id: '2.2.2.2'
            cost: 30
            priority: 20
            hello_interval: 10
            dead_interval: 40
            mtu_ignore: true
          - address: '10.10.120.1'
            authentication_type: 'NONE'
            authentication:
              password: 'pass2'
          - address: '10.19.119.1'
            authentication_type: 'NONE'
            md_authentication:
              - key_id: 10
                md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                encrypted: true
        bfd:
          enable: true
          bfd_profile: 'profile2'
        network: broadcast
    state: overridden

# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
# !
# interface Eth1/2
# !
# interface Eth1/3
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX186k2R2hUXaDloW8hfkApn5Zx5hCQy9usc= encrypted 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
# !
# sonic#

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

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

Ключ

Описание

after

list / elements=string

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

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

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

after(generated)

list / elements=string

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

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

Пример: ["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"]

Авторы

  • Santhosh kumar T (@santhosh-kt)

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

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

© 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/dellemc/enterprise_sonic/sonic_ospfv2_interfaces_module.html

Spec-Zone.ru

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