модуль dellemc.enterprise_sonic.sonic_ospfv3_area — настройка параметров областей OSPFv3 на 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_ospfv3_area.
Новое в dellemc.enterprise_sonic 3.1.0
Краткое описание
- Этот модуль настраивает параметры областей OSPFv3, работающего на коммутаторах SONiC.
- Перед настройкой областей OSPFv3 настройте глобальный экземпляр OSPFv3 или экземпляр OSPFv3 для VRF.
- Перед настройкой областей OSPFv3 настройте экземпляр OSPFv3.
Параметры
Параметр | Комментарии |
|---|---|
config список / элементы=словарь | Задает конфигурацию областей OSPFv3. stub и nssa являются взаимоисключающими. Если area_id=0 или 0.0.0.0, параметр stub/nssa указывать не следует. |
|
area_id строка / обязательный |
Идентификатор области сети (A.B.C.D или от 0 до 4294967295). |
|
filter_list_in строка |
Список фильтров префиксов между областями. Фильтрует входящие в область префиксы. Ожидается имя списка префиксов. |
|
filter_list_out строка |
Список фильтров префиксов между областями. Фильтрует исходящие из области префиксы. Ожидается имя списка префиксов. |
|
nssa словарь |
Конфигурация области типа NSSA. default_originate и no_summary являются взаимоисключающими. |
|
default_originate словарь |
Анонсировать маршрут по умолчанию для области NSSA. |
|
enabled логический / обязательный |
Включите анонсирование маршрута по умолчанию для области NSSA. Варианты:
|
|
metric целое число |
Задает метрику перераспределяемого маршрута (от 0 до 16777214). |
|
metric_type целое число |
Задает тип метрики перераспределяемого маршрута. Варианты:
|
|
enabled логический / обязательный |
Настраивает область как область типа NSSA. Варианты:
|
|
no_summary логический |
Отключает передачу маршрутов между областями в NSSA. Варианты:
|
|
ranges список / элементы=словарь |
Настраивает суммаризацию диапазонов адресов на пограничных маршрутизаторах. |
|
advertise логический |
Включает анонсирование диапазона адресов. При создании нового диапазона значение по умолчанию — True. Если задан параметр cost, во время выполнения плейбука значение advertise безусловно устанавливается в True. Варианты:
|
|
cost целое число |
Задает стоимость диапазона адресов (от 0 до 16777215). |
|
prefix строка / обязательный |
Задает префикс диапазона адресов. |
|
ranges список / элементы=словарь |
Настраивает суммаризацию диапазонов адресов на пограничных маршрутизаторах. |
|
advertise логический |
Включает анонсирование диапазона адресов. При создании нового диапазона значение по умолчанию — True. Если задан параметр cost, во время выполнения плейбука значение advertise безусловно устанавливается в True. Варианты:
|
|
cost целое число |
Задает стоимость диапазона адресов (от 0 до 16777215). |
|
prefix строка / обязательный |
Задает префикс диапазона адресов. |
|
stub словарь |
Конфигурация области типа STUB. |
|
enabled логический / обязательный |
Настраивает область как область типа STUB. Варианты:
|
|
no_summary логический |
Отключает передачу маршрутов между областями в STUB. Варианты:
|
|
vrf_name строка / обязательный |
Имя VRF, к которой относится эта область. |
state строка | Задает тип обновления конфигурации, которое будет выполнено на устройстве. Варианты:
|
Примечания
Примечание
- Поддерживает
check_mode. - Протестировано на Enterprise SONiC Distribution от Dell Technologies.
Примеры
# Using "deleted" state
#
# Before state:
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 stub no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.2 stub no-summary
# area 0.0.0.1 range 1::1/64 not-advertise
# area 0.0.0.1 range 1::2/64
# area 0.0.0.2 range 1::1/64
# area 0.0.0.3 range 1::3/24 cost 14
# sonic(config-router-ospfv3)#
- name: "test delete all settings for areas"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: deleted
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
- area_id: 0.0.0.2
vrf_name: Vrf1
ranges:
- prefix: 1::1/64
advertise: true
stub:
enabled: true
no_summary: true
# After state
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.3 range 1::3/24 cost 14
# sonic(config-router-ospfv3)#
# Using "deleted" state
# Before state:
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic(config-router-ospfv3)#
- name: "test clear subsections"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: deleted
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
nssa:
enabled: true
ranges: []
- area_id: 0.0.0.2
vrf_name: Vrf1
ranges: []
- area_id: 4
vrf_name: Vrf1
# After state
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# sonic(config-router-ospfv3)#
# Using "deleted" state
# Before state:
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# router ospfv3
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic#
- name: "test clear subsections"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: deleted
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
filter_list_in: pf1
filter_list_out: pf2
nssa:
enabled: true
range:
- prefix: 1::2/64
advertise: true
cost: 20
- area_id: 0.0.0.2
vrf_name: Vrf1
range:
- prefix: 1::2/64
- area_id: 3
vrf_name: default
- area_id: 4
vrf_name: default
stub:
enabled: true
no_summary: true
# After state
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::3/24 not-advertise
# router ospfv3
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.1 nssa
# area 0.0.0.4
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic#
# Using "merged" state
# Before state:
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf2
# !
# router ospfv3 vrf Vrf1
# sonic#
- name: merge examples of all settings
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: merged
config:
- area_id: 1
vrf_name: Vrf1
- area_id: 2
vrf_name: Vrf1
stub:
enabled: true
no_summary: true
- area_id: 3
vrf_name: Vrf1
filter_list_in: pf1
filter_list_out: pf2
ranges:
- prefix: 1::1/64
- prefix: 1::2/64
advertise: true
cost: 4
- prefix: 1::3/24
advertise: false
- prefix: 1::4/24
advertise: true
cost: 10
- area_id: 4
vrf_name: Vrf1
- area_id: 5
vrf_name: Vrf2
# After state
# -------------
# sonic# show running-configuration ospfv3
#
# outer ospfv3 vrf Vrf1
# area 0.0.0.1
# area 0.0.0.2 stub no-summary
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.3 filter-list prefix pf2 out
# area 0.0.0.4
# area 0.0.0.3 range 1::1/64
# area 0.0.0.3 range 1::2/64 advertise cost 4
# area 0.0.0.3 range 1::3/24 not-advertise
# area 0.0.0.3 range 1::4/24 advertise cost 10
# !
# router ospfv3 vrf Vrf2
# area 0.0.0.5
# sonic#
# Using "merged" state
# Before state:
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf2
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# sonic(config-router-ospfv3)#
- name: merge smallest group of settings
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: merged
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
- area_id: 0.0.0.2
vrf_name: Vrf1
nssa:
enabled: true
no_summary: true
- area_id: 0.0.0.3
vrf_name: Vrf1
ranges:
- prefix: 1::1/64
nssa:
enabled: true
default_originate:
enabled: true
- area_id: 0.0.0.4
vrf_name: Vrf2
stub:
enabled: true
- area_id: 0.0.0.5
vrf_name: Vrf2
filter_list_in: pf1
filter_list_out: pf2
# After state
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1
# area 0.0.0.2 nssa no-summary
# area 0.0.0.3 range 1::1/64
# area 0.0.0.3 nssa default-information-originate
# sonic(config-router-ospfv3)# router ospfv3 vrf Vrf2
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf2
# area 0.0.0.4 stub
# area 0.0.0.5 filter-list prefix pf1 in
# area 0.0.0.5 filter-list prefix pf2 out
# sonic(config-router-ospfv3)#
# Using "merged" state
# Before state:
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 stub no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.1 range 1::1/64 not-advertise
# area 0.0.0.1 range 1::2/64 advertise
# sonic(config-router-ospfv3)#
- name: "test merge all settings"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: merged
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
filter_list_in: pf2
filter_list_out: pf1
ranges:
- prefix: 1::1/64
advertise: true
cost: 12
- prefix: 1::2/64
advertise: false
stub:
enabled: true
no_summary: false
# After state
# -------------
# sonic(config-router-ospfv3)# show configuration
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 stub
# area 0.0.0.1 filter-list prefix pf2 in
# area 0.0.0.1 filter-list prefix pf1 out
# area 0.0.0.1 range 1::1/64 advertise cost 12
# area 0.0.0.1 range 1::2/64 not-advertise
# sonic(config-router-ospfv3)#
# Using "replaced" state
# Before state:
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# router ospfv3
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic#
- name: "replace areas"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: replaced
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
- area_id: 0.0.0.5
vrf_name: Vrf1
nssa:
enabled: true
default_originate:
enabled: true
metric: 10
metric_type: 1
ranges:
- prefix: "1::1/64"
cost: 15
- area_id: 0.0.0.4
vrf_name: Vrf1
stub:
no_summary: true
enabled: true
# After state
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1
# area 0.0.0.4 stub no-summary
# area 0.0.0.5 nssa nssa default-information-originate metric 10 metric-type 1
# area 0.0.0.5 nssa range 1::1/64 cost 15
# router ospfv3
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic#
# Using "overridden" state
# Before state:
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# router ospfv3
# area 0.0.0.1 nssa no-summary
# area 0.0.0.1 filter-list prefix pf1 in
# area 0.0.0.1 filter-list prefix pf2 out
# area 0.0.0.3 filter-list prefix pf1 in
# area 0.0.0.1 nssa
# area 0.0.0.4 stub no-summary
# area 0.0.0.1 nssa range 1::1/64
# area 0.0.0.1 nssa range 1::2/64 cost 20
# area 0.0.0.2 range 1::1/64 not-advertise
# area 0.0.0.2 range 1::2/64 advertise cost 4
# area 0.0.0.2 range 1::3/24 not-advertise
# sonic#
- name: "override areas"
dellemc.enterprise_sonic.sonic_ospfv3_area:
state: overridden
config:
- area_id: 0.0.0.1
vrf_name: Vrf1
- area_id: 0.0.0.5
vrf_name: Vrf1
nssa:
enabled: true
default_originate:
enabled: true
metric: 10
metric_type: 1
ranges:
- prefix: "1::1/64"
cost: 15
- area_id: 0.0.0.4
vrf_name: Vrf1
stub:
no_summary: true
enabled: true
# After state
# -------------
# sonic# show running-configuration ospfv3
# !
# router ospfv3 vrf Vrf1
# area 0.0.0.1
# area 0.0.0.4 stub no-summary
# area 0.0.0.5 nssa nssa default-information-originate metric 10 metric-type 1
# area 0.0.0.5 nssa range 1::1/64 cost 15
# router ospfv3
# sonic#
Возвращаемые значения
Общие возвращаемые значения описаны здесь; ниже приведены поля, уникальные для этого модуля:
Ключ | Описание |
|---|---|
after список / элементы=строка | Конфигурация, полученная в результате вызова модуля. Возвращается: при изменении Пример: |
after(generated) список / элементы=строка | Сгенерированная (вычисленная) конфигурация, которая была бы применена при вызове модуля. Возвращается: при Пример: |
before список / элементы=строка | Конфигурация до вызова модуля. Возвращается: всегда Пример: |
commands список / элементы=строка | Набор команд, отправленных на удаленное устройство. Возвращается: всегда Пример: |
Ссылки на коллекцию
© 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_ospfv3_area_module.html