| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
# Copyright 2020 Red Hat |
| 4 |
# GNU General Public License v3.0+ |
| 5 |
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
############################################# |
| 8 |
# WARNING # |
| 9 |
############################################# |
| 10 |
# |
| 11 |
# This file is auto generated by the resource |
| 12 |
# module builder playbook. |
| 13 |
# |
| 14 |
# Do not edit this file manually. |
| 15 |
# |
| 16 |
# Changes to this file will be over written |
| 17 |
# by the resource module builder. |
| 18 |
# |
| 19 |
# Changes should be made in the model used to |
| 20 |
# generate this file or in the resource module |
| 21 |
# builder template. |
| 22 |
# |
| 23 |
############################################# |
| 24 |
|
| 25 |
""" |
| 26 |
The module file for nxos_ospfv2 |
| 27 |
""" |
| 28 |
|
| 29 |
from __future__ import absolute_import, division, print_function |
| 30 |
|
| 31 |
|
| 32 |
__metaclass__ = type |
| 33 |
|
| 34 |
|
| 35 |
DOCUMENTATION = """ |
| 36 |
module: nxos_ospfv2 |
| 37 |
short_description: OSPFv2 resource module |
| 38 |
description: |
| 39 |
- This module manages OSPFv2 configuration on devices running Cisco NX-OS. |
| 40 |
version_added: 1.0.0 |
| 41 |
notes: |
| 42 |
- Tested against NX-OS 7.0(3)I5(1). |
| 43 |
- Unsupported for Cisco MDS |
| 44 |
- This module works with connection C(network_cli) and C(httpapi). |
| 45 |
author: Nilashish Chakraborty (@NilashishC) |
| 46 |
options: |
| 47 |
running_config: |
| 48 |
description: |
| 49 |
- This option is used only with state I(parsed). |
| 50 |
- The value of this option should be the output received from the NX-OS device |
| 51 |
by executing the command B(show running-config | section "^router ospf .*"). |
| 52 |
- The state I(parsed) reads the configuration from C(running_config) option and |
| 53 |
transforms it into Ansible structured data as per the resource module's argspec |
| 54 |
and the value is then returned in the I(parsed) key within the result. |
| 55 |
type: str |
| 56 |
config: |
| 57 |
description: A list of OSPF process configuration. |
| 58 |
type: dict |
| 59 |
suboptions: |
| 60 |
processes: |
| 61 |
description: |
| 62 |
- A list of OSPF instances' configurations. |
| 63 |
type: list |
| 64 |
elements: dict |
| 65 |
suboptions: |
| 66 |
areas: |
| 67 |
description: |
| 68 |
- Configure properties of OSPF Areas. |
| 69 |
type: list |
| 70 |
elements: dict |
| 71 |
suboptions: |
| 72 |
area_id: |
| 73 |
description: |
| 74 |
- The Area ID in IP Address format. |
| 75 |
type: str |
| 76 |
required: true |
| 77 |
authentication: |
| 78 |
description: |
| 79 |
- Authentication settings for the Area. |
| 80 |
type: dict |
| 81 |
suboptions: |
| 82 |
set: |
| 83 |
description: |
| 84 |
- Set authentication for the area. |
| 85 |
type: bool |
| 86 |
message_digest: |
| 87 |
description: |
| 88 |
- Use message-digest authentication. |
| 89 |
type: bool |
| 90 |
default_cost: |
| 91 |
description: |
| 92 |
- Specify the default cost for default summary LSA. |
| 93 |
type: int |
| 94 |
filter_list: |
| 95 |
description: |
| 96 |
- Filter prefixes between OSPF areas. |
| 97 |
type: list |
| 98 |
elements: dict |
| 99 |
suboptions: |
| 100 |
route_map: |
| 101 |
description: |
| 102 |
- The Route-map name. |
| 103 |
type: str |
| 104 |
required: true |
| 105 |
direction: |
| 106 |
description: |
| 107 |
- The direction to apply the route map. |
| 108 |
type: str |
| 109 |
choices: [in, out] |
| 110 |
required: true |
| 111 |
nssa: |
| 112 |
description: |
| 113 |
- NSSA settings for the area. |
| 114 |
type: dict |
| 115 |
suboptions: |
| 116 |
set: |
| 117 |
description: |
| 118 |
- Configure area as NSSA. |
| 119 |
type: bool |
| 120 |
default_information_originate: |
| 121 |
description: |
| 122 |
- Originate Type-7 default LSA into NSSA area. |
| 123 |
type: bool |
| 124 |
no_redistribution: |
| 125 |
description: |
| 126 |
- Do not send redistributed LSAs into NSSA area. |
| 127 |
type: bool |
| 128 |
no_summary: |
| 129 |
description: |
| 130 |
- Do not send summary LSAs into NSSA area. |
| 131 |
type: bool |
| 132 |
translate: |
| 133 |
description: |
| 134 |
- Translate LSA. |
| 135 |
type: dict |
| 136 |
suboptions: |
| 137 |
type7: |
| 138 |
description: |
| 139 |
- Translate from Type 7 to Type 5. |
| 140 |
type: dict |
| 141 |
suboptions: |
| 142 |
always: |
| 143 |
description: |
| 144 |
- Always translate LSAs |
| 145 |
type: bool |
| 146 |
never: |
| 147 |
description: |
| 148 |
- Never translate LSAs |
| 149 |
type: bool |
| 150 |
supress_fa: |
| 151 |
description: |
| 152 |
- Suppress forwarding address in translated LSAs. |
| 153 |
type: bool |
| 154 |
ranges: |
| 155 |
description: |
| 156 |
- Configure an address range for the area. |
| 157 |
type: list |
| 158 |
elements: dict |
| 159 |
suboptions: |
| 160 |
prefix: |
| 161 |
description: |
| 162 |
- IP in Prefix format (x.x.x.x/len) |
| 163 |
type: str |
| 164 |
required: true |
| 165 |
cost: |
| 166 |
description: |
| 167 |
- Cost to use for the range. |
| 168 |
type: int |
| 169 |
not_advertise: |
| 170 |
description: |
| 171 |
- Suppress advertising the specified range. |
| 172 |
type: bool |
| 173 |
stub: |
| 174 |
description: |
| 175 |
- Settings for configuring the area as a stub. |
| 176 |
type: dict |
| 177 |
suboptions: |
| 178 |
set: |
| 179 |
description: |
| 180 |
- Configure the area as a stub. |
| 181 |
type: bool |
| 182 |
no_summary: |
| 183 |
description: |
| 184 |
- Prevent ABR from sending summary LSAs into stub area. |
| 185 |
type: bool |
| 186 |
auto_cost: |
| 187 |
description: |
| 188 |
- Calculate OSPF cost according to bandwidth. |
| 189 |
type: dict |
| 190 |
suboptions: |
| 191 |
reference_bandwidth: |
| 192 |
description: |
| 193 |
- Reference bandwidth used to assign OSPF cost. |
| 194 |
type: int |
| 195 |
required: true |
| 196 |
unit: |
| 197 |
description: |
| 198 |
- Specify in which unit the reference bandwidth is specified. |
| 199 |
type: str |
| 200 |
required: true |
| 201 |
choices: [Gbps, Mbps] |
| 202 |
bfd: |
| 203 |
description: |
| 204 |
- Enable BFD on all OSPF interfaces. |
| 205 |
type: bool |
| 206 |
default_information: |
| 207 |
description: |
| 208 |
- Control distribution of default routes. |
| 209 |
type: dict |
| 210 |
suboptions: |
| 211 |
originate: |
| 212 |
description: |
| 213 |
- Distribute a default route. |
| 214 |
type: dict |
| 215 |
suboptions: |
| 216 |
set: |
| 217 |
description: |
| 218 |
- Enable distribution of default route. |
| 219 |
type: bool |
| 220 |
always: |
| 221 |
description: |
| 222 |
- Always advertise a default route. |
| 223 |
type: bool |
| 224 |
route_map: |
| 225 |
description: |
| 226 |
- Policy to control distribution of default routes |
| 227 |
type: str |
| 228 |
default_metric: |
| 229 |
description: |
| 230 |
- Specify default metric for redistributed routes. |
| 231 |
type: int |
| 232 |
distance: |
| 233 |
description: |
| 234 |
- Configure the OSPF administrative distance. |
| 235 |
type: int |
| 236 |
flush_routes: |
| 237 |
description: |
| 238 |
- Flush routes on a non-graceful controlled restart. |
| 239 |
type: bool |
| 240 |
graceful_restart: |
| 241 |
description: |
| 242 |
- Configure graceful restart. |
| 243 |
type: dict |
| 244 |
suboptions: |
| 245 |
set: |
| 246 |
description: |
| 247 |
- Enable graceful-restart. |
| 248 |
type: bool |
| 249 |
grace_period: |
| 250 |
description: |
| 251 |
- Configure maximum interval to restart gracefully. |
| 252 |
type: int |
| 253 |
helper_disable: |
| 254 |
description: |
| 255 |
- Enable/Disable helper mode. |
| 256 |
type: bool |
| 257 |
isolate: |
| 258 |
description: |
| 259 |
- Isolate this router from OSPF perspective. |
| 260 |
type: bool |
| 261 |
log_adjacency_changes: |
| 262 |
description: |
| 263 |
- Log changes in adjacency state. |
| 264 |
type: dict |
| 265 |
suboptions: |
| 266 |
log: |
| 267 |
description: |
| 268 |
- Enable/disable logging changes in adjacency state. |
| 269 |
type: bool |
| 270 |
detail: |
| 271 |
description: |
| 272 |
- Notify all state changes. |
| 273 |
type: bool |
| 274 |
max_lsa: |
| 275 |
description: |
| 276 |
- Feature to limit the number of non-self-originated LSAs. |
| 277 |
type: dict |
| 278 |
suboptions: |
| 279 |
max_non_self_generated_lsa: |
| 280 |
description: |
| 281 |
- Set the maximum number of non self-generated LSAs. |
| 282 |
type: int |
| 283 |
required: true |
| 284 |
threshold: |
| 285 |
description: |
| 286 |
- Threshold value (%) at which to generate a warning message. |
| 287 |
type: int |
| 288 |
ignore_count: |
| 289 |
description: |
| 290 |
- Set count on how many times adjacencies can be suppressed. |
| 291 |
type: int |
| 292 |
ignore_time: |
| 293 |
description: |
| 294 |
- Set time during which all adjacencies are suppressed. |
| 295 |
type: int |
| 296 |
reset_time: |
| 297 |
description: |
| 298 |
- Set number of minutes after which ignore-count is reset to zero. |
| 299 |
type: int |
| 300 |
warning_only: |
| 301 |
description: |
| 302 |
- Log a warning message when limit is exceeded. |
| 303 |
type: bool |
| 304 |
max_metric: |
| 305 |
description: |
| 306 |
- Maximize the cost metric. |
| 307 |
type: dict |
| 308 |
suboptions: |
| 309 |
router_lsa: |
| 310 |
description: |
| 311 |
- Router LSA configuration. |
| 312 |
type: dict |
| 313 |
suboptions: |
| 314 |
set: |
| 315 |
description: |
| 316 |
- Set router-lsa attribute. |
| 317 |
type: bool |
| 318 |
external_lsa: |
| 319 |
description: |
| 320 |
- External LSA configuration. |
| 321 |
type: dict |
| 322 |
suboptions: |
| 323 |
set: |
| 324 |
description: |
| 325 |
- Set external-lsa attribute. |
| 326 |
type: bool |
| 327 |
max_metric_value: |
| 328 |
description: |
| 329 |
- Set max metric value for external LSAs. |
| 330 |
type: int |
| 331 |
include_stub: |
| 332 |
description: |
| 333 |
- Advertise Max metric for Stub links as well. |
| 334 |
type: bool |
| 335 |
on_startup: |
| 336 |
description: |
| 337 |
- Effective only at startup. |
| 338 |
type: dict |
| 339 |
suboptions: |
| 340 |
set: |
| 341 |
description: |
| 342 |
- Set on-startup attribute. |
| 343 |
type: bool |
| 344 |
wait_period: |
| 345 |
description: |
| 346 |
- Wait period in seconds after startup. |
| 347 |
type: int |
| 348 |
wait_for_bgp_asn: |
| 349 |
description: |
| 350 |
- ASN of BGP to wait for. |
| 351 |
type: int |
| 352 |
summary_lsa: |
| 353 |
description: |
| 354 |
- Summary LSAs configuration. |
| 355 |
type: dict |
| 356 |
suboptions: |
| 357 |
set: |
| 358 |
description: |
| 359 |
- Set summary-lsa attribute. |
| 360 |
type: bool |
| 361 |
max_metric_value: |
| 362 |
description: |
| 363 |
- Max metric value for summary LSAs. |
| 364 |
type: int |
| 365 |
maximum_paths: |
| 366 |
description: |
| 367 |
- Maximum paths per destination. |
| 368 |
type: int |
| 369 |
mpls: |
| 370 |
description: |
| 371 |
- OSPF MPLS configuration settings. |
| 372 |
type: dict |
| 373 |
suboptions: |
| 374 |
traffic_eng: |
| 375 |
description: |
| 376 |
- OSPF MPLS Traffic Engineering commands. |
| 377 |
type: dict |
| 378 |
suboptions: |
| 379 |
areas: |
| 380 |
description: |
| 381 |
- List of Area IDs. |
| 382 |
type: list |
| 383 |
elements: dict |
| 384 |
suboptions: |
| 385 |
area_id: |
| 386 |
description: |
| 387 |
- Area Id in ip address format. |
| 388 |
type: str |
| 389 |
multicast_intact: |
| 390 |
description: |
| 391 |
- MPLS TE multicast support. |
| 392 |
type: bool |
| 393 |
router_id: |
| 394 |
description: |
| 395 |
- Router ID associated with TE. |
| 396 |
type: str |
| 397 |
name_lookup: |
| 398 |
description: |
| 399 |
- Display OSPF router ids as DNS names. |
| 400 |
type: bool |
| 401 |
passive_interface: |
| 402 |
description: |
| 403 |
- Suppress routing updates on the interface. |
| 404 |
type: dict |
| 405 |
suboptions: |
| 406 |
default: |
| 407 |
description: |
| 408 |
- Interfaces passive by default. |
| 409 |
type: bool |
| 410 |
process_id: |
| 411 |
description: |
| 412 |
- The OSPF process tag. |
| 413 |
type: str |
| 414 |
required: true |
| 415 |
redistribute: |
| 416 |
description: |
| 417 |
- Redistribute information from another routing protocol. |
| 418 |
type: list |
| 419 |
elements: dict |
| 420 |
suboptions: |
| 421 |
protocol: |
| 422 |
description: |
| 423 |
- The name of the protocol. |
| 424 |
type: str |
| 425 |
choices: [bgp, direct, eigrp, isis, lisp, ospf, rip, static] |
| 426 |
required: true |
| 427 |
id: |
| 428 |
description: |
| 429 |
- The identifier for the protocol specified. |
| 430 |
type: str |
| 431 |
route_map: |
| 432 |
description: |
| 433 |
- The route map policy to constrain redistribution. |
| 434 |
type: str |
| 435 |
required: true |
| 436 |
rfc1583compatibility: |
| 437 |
description: |
| 438 |
- Configure 1583 compatibility for external path preferences. |
| 439 |
type: bool |
| 440 |
router_id: |
| 441 |
description: |
| 442 |
- Set OSPF process router-id. |
| 443 |
type: str |
| 444 |
shutdown: |
| 445 |
description: |
| 446 |
- Shutdown the OSPF protocol instance. |
| 447 |
type: bool |
| 448 |
summary_address: |
| 449 |
description: |
| 450 |
- Configure route summarization for redistribution. |
| 451 |
type: list |
| 452 |
elements: dict |
| 453 |
suboptions: |
| 454 |
prefix: |
| 455 |
description: |
| 456 |
- IP prefix in format x.x.x.x/ml. |
| 457 |
type: str |
| 458 |
required: true |
| 459 |
not_advertise: |
| 460 |
description: |
| 461 |
- Suppress advertising the specified summary. |
| 462 |
type: bool |
| 463 |
tag: |
| 464 |
description: |
| 465 |
- A 32-bit tag value. |
| 466 |
type: int |
| 467 |
table_map: |
| 468 |
description: |
| 469 |
- Policy for filtering/modifying OSPF routes before sending them to RIB. |
| 470 |
type: dict |
| 471 |
suboptions: |
| 472 |
name: |
| 473 |
description: |
| 474 |
- The Route Map name. |
| 475 |
type: str |
| 476 |
required: true |
| 477 |
filter: |
| 478 |
description: |
| 479 |
- Block the OSPF routes from being sent to RIB. |
| 480 |
type: bool |
| 481 |
timers: |
| 482 |
description: |
| 483 |
- Configure timer related constants. |
| 484 |
type: dict |
| 485 |
suboptions: |
| 486 |
lsa_arrival: |
| 487 |
description: |
| 488 |
- Mimimum interval between arrival of a LSA. |
| 489 |
type: int |
| 490 |
lsa_group_pacing: |
| 491 |
description: |
| 492 |
- LSA group refresh/maxage interval. |
| 493 |
type: int |
| 494 |
throttle: |
| 495 |
description: |
| 496 |
- Configure throttle related constants. |
| 497 |
type: dict |
| 498 |
suboptions: |
| 499 |
lsa: |
| 500 |
description: |
| 501 |
- Set rate-limiting for LSA generation. |
| 502 |
type: dict |
| 503 |
suboptions: |
| 504 |
start_interval: |
| 505 |
description: |
| 506 |
- The start interval. |
| 507 |
type: int |
| 508 |
hold_interval: |
| 509 |
description: |
| 510 |
- The hold interval. |
| 511 |
type: int |
| 512 |
max_interval: |
| 513 |
description: |
| 514 |
- The max interval. |
| 515 |
type: int |
| 516 |
spf: |
| 517 |
description: |
| 518 |
- Set OSPF SPF timers. |
| 519 |
type: dict |
| 520 |
suboptions: |
| 521 |
initial_spf_delay: |
| 522 |
description: |
| 523 |
- Initial SPF schedule delay in milliseconds. |
| 524 |
type: int |
| 525 |
min_hold_time: |
| 526 |
description: |
| 527 |
- Minimum hold time between SPF calculations. |
| 528 |
type: int |
| 529 |
max_wait_time: |
| 530 |
description: |
| 531 |
- Maximum wait time between SPF calculations. |
| 532 |
type: int |
| 533 |
vrfs: |
| 534 |
description: |
| 535 |
- Configure VRF specific OSPF settings. |
| 536 |
type: list |
| 537 |
elements: dict |
| 538 |
suboptions: |
| 539 |
areas: |
| 540 |
description: |
| 541 |
- Configure properties of OSPF Areas. |
| 542 |
type: list |
| 543 |
elements: dict |
| 544 |
suboptions: |
| 545 |
area_id: |
| 546 |
description: |
| 547 |
- The Area ID in IP Address format. |
| 548 |
type: str |
| 549 |
required: true |
| 550 |
authentication: |
| 551 |
description: |
| 552 |
- Authentication settings for the Area. |
| 553 |
type: dict |
| 554 |
suboptions: |
| 555 |
set: |
| 556 |
description: |
| 557 |
- Set authentication for the area. |
| 558 |
type: bool |
| 559 |
message_digest: |
| 560 |
description: |
| 561 |
- Use message-digest authentication. |
| 562 |
type: bool |
| 563 |
default_cost: |
| 564 |
description: |
| 565 |
- Specify the default cost for default summary LSA. |
| 566 |
type: int |
| 567 |
filter_list: |
| 568 |
description: |
| 569 |
- Filter prefixes between OSPF areas. |
| 570 |
type: list |
| 571 |
elements: dict |
| 572 |
suboptions: |
| 573 |
route_map: |
| 574 |
description: |
| 575 |
- The Route-map name. |
| 576 |
type: str |
| 577 |
required: true |
| 578 |
direction: |
| 579 |
description: |
| 580 |
- The direction to apply the route map. |
| 581 |
type: str |
| 582 |
choices: [in, out] |
| 583 |
required: true |
| 584 |
nssa: |
| 585 |
description: |
| 586 |
- NSSA settings for the area. |
| 587 |
type: dict |
| 588 |
suboptions: |
| 589 |
set: |
| 590 |
description: |
| 591 |
- Configure area as NSSA. |
| 592 |
type: bool |
| 593 |
default_information_originate: |
| 594 |
description: |
| 595 |
- Originate Type-7 default LSA into NSSA area. |
| 596 |
type: bool |
| 597 |
no_redistribution: |
| 598 |
description: |
| 599 |
- Do not send redistributed LSAs into NSSA area. |
| 600 |
type: bool |
| 601 |
no_summary: |
| 602 |
description: |
| 603 |
- Do not send summary LSAs into NSSA area. |
| 604 |
type: bool |
| 605 |
translate: |
| 606 |
description: |
| 607 |
- Translate LSA. |
| 608 |
type: dict |
| 609 |
suboptions: |
| 610 |
type7: |
| 611 |
description: |
| 612 |
- Translate from Type 7 to Type 5. |
| 613 |
type: dict |
| 614 |
suboptions: |
| 615 |
always: |
| 616 |
description: |
| 617 |
- Always translate LSAs |
| 618 |
type: bool |
| 619 |
never: |
| 620 |
description: |
| 621 |
- Never translate LSAs |
| 622 |
type: bool |
| 623 |
supress_fa: |
| 624 |
description: |
| 625 |
- Suppress forwarding address in translated LSAs. |
| 626 |
type: bool |
| 627 |
ranges: |
| 628 |
description: |
| 629 |
- Configure an address range for the area. |
| 630 |
type: list |
| 631 |
elements: dict |
| 632 |
suboptions: |
| 633 |
prefix: |
| 634 |
description: |
| 635 |
- IP in Prefix format (x.x.x.x/len) |
| 636 |
type: str |
| 637 |
required: true |
| 638 |
cost: |
| 639 |
description: |
| 640 |
- Cost to use for the range. |
| 641 |
type: int |
| 642 |
not_advertise: |
| 643 |
description: |
| 644 |
- Suppress advertising the specified range. |
| 645 |
type: bool |
| 646 |
stub: |
| 647 |
description: |
| 648 |
- Settings for configuring the area as a stub. |
| 649 |
type: dict |
| 650 |
suboptions: |
| 651 |
set: |
| 652 |
description: |
| 653 |
- Configure the area as a stub. |
| 654 |
type: bool |
| 655 |
no_summary: |
| 656 |
description: |
| 657 |
- Prevent ABR from sending summary LSAs into stub area. |
| 658 |
type: bool |
| 659 |
auto_cost: |
| 660 |
description: |
| 661 |
- Calculate OSPF cost according to bandwidth. |
| 662 |
type: dict |
| 663 |
suboptions: |
| 664 |
reference_bandwidth: |
| 665 |
description: |
| 666 |
- Reference bandwidth used to assign OSPF cost. |
| 667 |
type: int |
| 668 |
required: true |
| 669 |
unit: |
| 670 |
description: |
| 671 |
- Specify in which unit the reference bandwidth is specified. |
| 672 |
type: str |
| 673 |
required: True |
| 674 |
choices: [Gbps, Mbps] |
| 675 |
bfd: |
| 676 |
description: |
| 677 |
- Enable BFD on all OSPF interfaces. |
| 678 |
type: bool |
| 679 |
default_information: |
| 680 |
description: |
| 681 |
- Control distribution of default routes. |
| 682 |
type: dict |
| 683 |
suboptions: |
| 684 |
originate: |
| 685 |
description: |
| 686 |
- Distribute a default route. |
| 687 |
type: dict |
| 688 |
suboptions: |
| 689 |
set: |
| 690 |
description: |
| 691 |
- Enable distribution of default route. |
| 692 |
type: bool |
| 693 |
always: |
| 694 |
description: |
| 695 |
- Always advertise a default route. |
| 696 |
type: bool |
| 697 |
route_map: |
| 698 |
description: |
| 699 |
- Policy to control distribution of default routes |
| 700 |
type: str |
| 701 |
default_metric: |
| 702 |
description: |
| 703 |
- Specify default metric for redistributed routes. |
| 704 |
type: int |
| 705 |
distance: |
| 706 |
description: |
| 707 |
- Configure the OSPF administrative distance. |
| 708 |
type: int |
| 709 |
down_bit_ignore: |
| 710 |
description: |
| 711 |
- Configure a PE router to ignore the DN bit for network summary, |
| 712 |
external and NSSA external LSA. |
| 713 |
type: bool |
| 714 |
capability: |
| 715 |
description: |
| 716 |
- OSPF capability settings. |
| 717 |
type: dict |
| 718 |
suboptions: |
| 719 |
vrf_lite: |
| 720 |
description: |
| 721 |
- Enable VRF-lite capability settings. |
| 722 |
type: dict |
| 723 |
suboptions: |
| 724 |
set: |
| 725 |
description: |
| 726 |
- Enable VRF-lite support. |
| 727 |
type: bool |
| 728 |
evpn: |
| 729 |
description: |
| 730 |
- Ethernet VPN. |
| 731 |
type: bool |
| 732 |
graceful_restart: |
| 733 |
description: |
| 734 |
- Configure graceful restart. |
| 735 |
type: dict |
| 736 |
suboptions: |
| 737 |
set: |
| 738 |
description: |
| 739 |
- Enable graceful-restart. |
| 740 |
type: bool |
| 741 |
grace_period: |
| 742 |
description: |
| 743 |
- Configure maximum interval to restart gracefully. |
| 744 |
type: int |
| 745 |
helper_disable: |
| 746 |
description: |
| 747 |
- Enable/Disable helper mode. |
| 748 |
type: bool |
| 749 |
log_adjacency_changes: |
| 750 |
description: |
| 751 |
- Log changes in adjacency state. |
| 752 |
type: dict |
| 753 |
suboptions: |
| 754 |
log: |
| 755 |
description: |
| 756 |
- Enable/disable logging changes in adjacency state. |
| 757 |
type: bool |
| 758 |
detail: |
| 759 |
description: |
| 760 |
- Notify all state changes. |
| 761 |
type: bool |
| 762 |
max_lsa: |
| 763 |
description: |
| 764 |
- Feature to limit the number of non-self-originated LSAs. |
| 765 |
type: dict |
| 766 |
suboptions: |
| 767 |
max_non_self_generated_lsa: |
| 768 |
description: |
| 769 |
- Set the maximum number of non self-generated LSAs. |
| 770 |
type: int |
| 771 |
required: true |
| 772 |
threshold: |
| 773 |
description: |
| 774 |
- Threshold value (%) at which to generate a warning message. |
| 775 |
type: int |
| 776 |
ignore_count: |
| 777 |
description: |
| 778 |
- Set count on how many times adjacencies can be suppressed. |
| 779 |
type: int |
| 780 |
ignore_time: |
| 781 |
description: |
| 782 |
- Set time during which all adjacencies are suppressed. |
| 783 |
type: int |
| 784 |
reset_time: |
| 785 |
description: |
| 786 |
- Set number of minutes after which ignore-count is reset to zero. |
| 787 |
type: int |
| 788 |
warning_only: |
| 789 |
description: |
| 790 |
- Log a warning message when limit is exceeded. |
| 791 |
type: bool |
| 792 |
max_metric: |
| 793 |
description: |
| 794 |
- Maximize the cost metric. |
| 795 |
type: dict |
| 796 |
suboptions: |
| 797 |
router_lsa: |
| 798 |
description: |
| 799 |
- Router LSA configuration. |
| 800 |
type: dict |
| 801 |
suboptions: |
| 802 |
set: |
| 803 |
description: |
| 804 |
- Set router-lsa attribute. |
| 805 |
type: bool |
| 806 |
external_lsa: |
| 807 |
description: |
| 808 |
- External LSA configuration. |
| 809 |
type: dict |
| 810 |
suboptions: |
| 811 |
set: |
| 812 |
description: |
| 813 |
- Set external-lsa attribute. |
| 814 |
type: bool |
| 815 |
max_metric_value: |
| 816 |
description: |
| 817 |
- Set max metric value for external LSAs. |
| 818 |
type: int |
| 819 |
include_stub: |
| 820 |
description: |
| 821 |
- Advertise Max metric for Stub links as well. |
| 822 |
type: bool |
| 823 |
on_startup: |
| 824 |
description: |
| 825 |
- Effective only at startup. |
| 826 |
type: dict |
| 827 |
suboptions: |
| 828 |
set: |
| 829 |
description: |
| 830 |
- Set on-startup attribute. |
| 831 |
type: bool |
| 832 |
wait_period: |
| 833 |
description: |
| 834 |
- Wait period in seconds after startup. |
| 835 |
type: int |
| 836 |
wait_for_bgp_asn: |
| 837 |
description: |
| 838 |
- ASN of BGP to wait for. |
| 839 |
type: int |
| 840 |
summary_lsa: |
| 841 |
description: |
| 842 |
- Summary LSAs configuration. |
| 843 |
type: dict |
| 844 |
suboptions: |
| 845 |
set: |
| 846 |
description: |
| 847 |
- Set summary-lsa attribute. |
| 848 |
type: bool |
| 849 |
max_metric_value: |
| 850 |
description: |
| 851 |
- Max metric value for summary LSAs. |
| 852 |
type: int |
| 853 |
maximum_paths: |
| 854 |
description: |
| 855 |
- Maximum paths per destination. |
| 856 |
type: int |
| 857 |
name_lookup: |
| 858 |
description: |
| 859 |
- Display OSPF router ids as DNS names. |
| 860 |
type: bool |
| 861 |
passive_interface: |
| 862 |
description: |
| 863 |
- Suppress routing updates on the interface. |
| 864 |
type: dict |
| 865 |
suboptions: |
| 866 |
default: |
| 867 |
description: |
| 868 |
- Interfaces passive by default. |
| 869 |
type: bool |
| 870 |
redistribute: |
| 871 |
description: |
| 872 |
- Redistribute information from another routing protocol. |
| 873 |
type: list |
| 874 |
elements: dict |
| 875 |
suboptions: |
| 876 |
protocol: |
| 877 |
description: |
| 878 |
- The name of the protocol. |
| 879 |
type: str |
| 880 |
choices: [bgp, direct, eigrp, isis, lisp, ospf, rip, static] |
| 881 |
required: true |
| 882 |
id: |
| 883 |
description: |
| 884 |
- The identifier for the protocol specified. |
| 885 |
type: str |
| 886 |
route_map: |
| 887 |
description: |
| 888 |
- The route map policy to constrain redistribution. |
| 889 |
type: str |
| 890 |
required: true |
| 891 |
rfc1583compatibility: |
| 892 |
description: |
| 893 |
- Configure 1583 compatibility for external path preferences. |
| 894 |
type: bool |
| 895 |
router_id: |
| 896 |
description: |
| 897 |
- Set OSPF process router-id. |
| 898 |
type: str |
| 899 |
shutdown: |
| 900 |
description: |
| 901 |
- Shutdown the OSPF protocol instance. |
| 902 |
type: bool |
| 903 |
summary_address: |
| 904 |
description: |
| 905 |
- Configure route summarization for redistribution. |
| 906 |
type: list |
| 907 |
elements: dict |
| 908 |
suboptions: |
| 909 |
prefix: |
| 910 |
description: |
| 911 |
- IP prefix in format x.x.x.x/ml. |
| 912 |
type: str |
| 913 |
required: true |
| 914 |
not_advertise: |
| 915 |
description: |
| 916 |
- Suppress advertising the specified summary. |
| 917 |
type: bool |
| 918 |
tag: |
| 919 |
description: |
| 920 |
- A 32-bit tag value. |
| 921 |
type: int |
| 922 |
table_map: |
| 923 |
description: |
| 924 |
- Policy for filtering/modifying OSPF routes before sending them to |
| 925 |
RIB. |
| 926 |
type: dict |
| 927 |
suboptions: |
| 928 |
name: |
| 929 |
description: |
| 930 |
- The Route Map name. |
| 931 |
type: str |
| 932 |
required: true |
| 933 |
filter: |
| 934 |
description: |
| 935 |
- Block the OSPF routes from being sent to RIB. |
| 936 |
type: bool |
| 937 |
timers: |
| 938 |
description: |
| 939 |
- Configure timer related constants. |
| 940 |
type: dict |
| 941 |
suboptions: |
| 942 |
lsa_arrival: |
| 943 |
description: |
| 944 |
- Mimimum interval between arrival of a LSA. |
| 945 |
type: int |
| 946 |
lsa_group_pacing: |
| 947 |
description: |
| 948 |
- LSA group refresh/maxage interval. |
| 949 |
type: int |
| 950 |
throttle: |
| 951 |
description: |
| 952 |
- Configure throttle related constants. |
| 953 |
type: dict |
| 954 |
suboptions: |
| 955 |
lsa: |
| 956 |
description: |
| 957 |
- Set rate-limiting for LSA generation. |
| 958 |
type: dict |
| 959 |
suboptions: |
| 960 |
start_interval: |
| 961 |
description: |
| 962 |
- The start interval. |
| 963 |
type: int |
| 964 |
hold_interval: |
| 965 |
description: |
| 966 |
- The hold interval. |
| 967 |
type: int |
| 968 |
max_interval: |
| 969 |
description: |
| 970 |
- The max interval. |
| 971 |
type: int |
| 972 |
spf: |
| 973 |
description: |
| 974 |
- Set OSPF SPF timers. |
| 975 |
type: dict |
| 976 |
suboptions: |
| 977 |
initial_spf_delay: |
| 978 |
description: |
| 979 |
- Initial SPF schedule delay in milliseconds. |
| 980 |
type: int |
| 981 |
min_hold_time: |
| 982 |
description: |
| 983 |
- Minimum hold time between SPF calculations. |
| 984 |
type: int |
| 985 |
max_wait_time: |
| 986 |
description: |
| 987 |
- Maximum wait time between SPF calculations. |
| 988 |
type: int |
| 989 |
vrf: |
| 990 |
description: |
| 991 |
- Name/Identifier of the VRF. |
| 992 |
type: str |
| 993 |
required: true |
| 994 |
state: |
| 995 |
description: |
| 996 |
- The state the configuration should be left in. |
| 997 |
type: str |
| 998 |
choices: |
| 999 |
- merged |
| 1000 |
- replaced |
| 1001 |
- overridden |
| 1002 |
- deleted |
| 1003 |
- gathered |
| 1004 |
- parsed |
| 1005 |
- rendered |
| 1006 |
default: merged |
| 1007 |
|
| 1008 |
""" |
| 1009 |
EXAMPLES = """ |
| 1010 |
# Using merged |
| 1011 |
|
| 1012 |
# Before state: |
| 1013 |
# ------------- |
| 1014 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1015 |
# nxos-9k-rdo# |
| 1016 |
|
| 1017 |
- name: Merge the provided configuration with the existing running configuration |
| 1018 |
cisco.nxos.nxos_ospfv2: |
| 1019 |
config: |
| 1020 |
processes: |
| 1021 |
- process_id: 100 |
| 1022 |
router_id: 203.0.113.20 |
| 1023 |
- process_id: 102 |
| 1024 |
router_id: 198.51.100.1 |
| 1025 |
areas: |
| 1026 |
- area_id: 0.0.0.100 |
| 1027 |
filter_list: |
| 1028 |
- route_map: rmap_1 |
| 1029 |
direction: in |
| 1030 |
- route_map: rmap_2 |
| 1031 |
direction: out |
| 1032 |
ranges: |
| 1033 |
- prefix: 198.51.100.64/27 |
| 1034 |
not_advertise: true |
| 1035 |
- prefix: 198.51.100.96/27 |
| 1036 |
cost: 120 |
| 1037 |
- area_id: 0.0.0.101 |
| 1038 |
authentication: |
| 1039 |
message_digest: true |
| 1040 |
redistribute: |
| 1041 |
- protocol: eigrp |
| 1042 |
id: 120 |
| 1043 |
route_map: rmap_1 |
| 1044 |
- protocol: direct |
| 1045 |
route_map: ospf102-direct-connect |
| 1046 |
vrfs: |
| 1047 |
- vrf: zone1 |
| 1048 |
router_id: 198.51.100.129 |
| 1049 |
redistribute: |
| 1050 |
- protocol: static |
| 1051 |
route_map: zone1-static-connect |
| 1052 |
summary_address: |
| 1053 |
- prefix: 198.51.100.128/27 |
| 1054 |
tag: 121 |
| 1055 |
- prefix: 198.51.100.160/27 |
| 1056 |
areas: |
| 1057 |
- area_id: 0.0.0.102 |
| 1058 |
nssa: |
| 1059 |
default_information_originate: true |
| 1060 |
no_summary: true |
| 1061 |
- area_id: 0.0.0.103 |
| 1062 |
nssa: |
| 1063 |
no_summary: true |
| 1064 |
translate: |
| 1065 |
type7: |
| 1066 |
always: true |
| 1067 |
- vrf: zone2 |
| 1068 |
auto_cost: |
| 1069 |
reference_bandwidth: 45 |
| 1070 |
unit: Gbps |
| 1071 |
state: merged |
| 1072 |
|
| 1073 |
# Task output: |
| 1074 |
# ------------ |
| 1075 |
# before: {} |
| 1076 |
# |
| 1077 |
# commands: |
| 1078 |
# - router ospf 102 |
| 1079 |
# - router-id 198.51.100.1 |
| 1080 |
# - redistribute eigrp 120 route-map rmap_1 |
| 1081 |
# - redistribute direct route-map ospf102-direct-connect |
| 1082 |
# - area 0.0.0.100 filter-list route-map rmap_1 in |
| 1083 |
# - area 0.0.0.100 filter-list route-map rmap_2 out |
| 1084 |
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1085 |
# - area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1086 |
# - area 0.0.0.101 authentication message-digest |
| 1087 |
# - vrf zone1 |
| 1088 |
# - router-id 198.51.100.129 |
| 1089 |
# - summary-address 198.51.100.128/27 tag 121 |
| 1090 |
# - summary-address 198.51.100.160/27 |
| 1091 |
# - redistribute static route-map zone1-static-connect |
| 1092 |
# - area 0.0.0.102 nssa no-summary default-information-originate |
| 1093 |
# - area 0.0.0.103 nssa no-summary |
| 1094 |
# - area 0.0.0.103 nssa translate type7 always |
| 1095 |
# - vrf zone2 |
| 1096 |
# - auto-cost reference-bandwidth 45 Gbps |
| 1097 |
# - router ospf 100 |
| 1098 |
# - router-id 203.0.113.20 |
| 1099 |
# |
| 1100 |
# after: |
| 1101 |
# processes: |
| 1102 |
# - process_id: "100" |
| 1103 |
# router_id: 203.0.113.20 |
| 1104 |
# - areas: |
| 1105 |
# - area_id: 0.0.0.100 |
| 1106 |
# filter_list: |
| 1107 |
# - direction: out |
| 1108 |
# route_map: rmap_2 |
| 1109 |
# - direction: in |
| 1110 |
# route_map: rmap_1 |
| 1111 |
# ranges: |
| 1112 |
# - not_advertise: true |
| 1113 |
# prefix: 198.51.100.64/27 |
| 1114 |
# - cost: 120 |
| 1115 |
# prefix: 198.51.100.96/27 |
| 1116 |
# - area_id: 0.0.0.101 |
| 1117 |
# authentication: |
| 1118 |
# message_digest: true |
| 1119 |
# process_id: "102" |
| 1120 |
# redistribute: |
| 1121 |
# - protocol: direct |
| 1122 |
# route_map: ospf102-direct-connect |
| 1123 |
# - id: "120" |
| 1124 |
# protocol: eigrp |
| 1125 |
# route_map: rmap_1 |
| 1126 |
# router_id: 198.51.100.1 |
| 1127 |
# vrfs: |
| 1128 |
# - areas: |
| 1129 |
# - area_id: 0.0.0.102 |
| 1130 |
# nssa: |
| 1131 |
# default_information_originate: true |
| 1132 |
# no_summary: true |
| 1133 |
# - area_id: 0.0.0.103 |
| 1134 |
# nssa: |
| 1135 |
# no_summary: true |
| 1136 |
# translate: |
| 1137 |
# type7: |
| 1138 |
# always: true |
| 1139 |
# redistribute: |
| 1140 |
# - protocol: static |
| 1141 |
# route_map: zone1-static-connect |
| 1142 |
# router_id: 198.51.100.129 |
| 1143 |
# vrf: zone1 |
| 1144 |
# - auto_cost: |
| 1145 |
# reference_bandwidth: 45 |
| 1146 |
# unit: Gbps |
| 1147 |
# vrf: zone2 |
| 1148 |
# |
| 1149 |
|
| 1150 |
# After state: |
| 1151 |
# ------------ |
| 1152 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1153 |
# router ospf 100 |
| 1154 |
# router-id 203.0.113.20 |
| 1155 |
# router ospf 102 |
| 1156 |
# router-id 198.51.100.1 |
| 1157 |
# redistribute direct route-map ospf102-direct-connect |
| 1158 |
# redistribute eigrp 120 route-map rmap_1 |
| 1159 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1160 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1161 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1162 |
# area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1163 |
# area 0.0.0.101 authentication message-digest |
| 1164 |
# vrf zone1 |
| 1165 |
# router-id 198.51.100.129 |
| 1166 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1167 |
# area 0.0.0.103 nssa no-summary |
| 1168 |
# area 0.0.0.103 nssa translate type7 always |
| 1169 |
# redistribute static route-map zone1-static-connect |
| 1170 |
# summary-address 198.51.100.128/27 tag 121 |
| 1171 |
# summary-address 198.51.100.160/27 |
| 1172 |
# vrf zone2 |
| 1173 |
# auto-cost reference-bandwidth 45 Gbps |
| 1174 |
|
| 1175 |
# Using replaced |
| 1176 |
|
| 1177 |
# Before state: |
| 1178 |
# ------------ |
| 1179 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1180 |
# router ospf 100 |
| 1181 |
# router-id 203.0.113.20 |
| 1182 |
# router ospf 102 |
| 1183 |
# router-id 198.51.100.1 |
| 1184 |
# redistribute direct route-map ospf102-direct-connect |
| 1185 |
# redistribute eigrp 120 route-map rmap_1 |
| 1186 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1187 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1188 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1189 |
# area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1190 |
# area 0.0.0.101 authentication message-digest |
| 1191 |
# vrf zone1 |
| 1192 |
# router-id 198.51.100.129 |
| 1193 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1194 |
# area 0.0.0.103 nssa no-summary |
| 1195 |
# area 0.0.0.103 nssa translate type7 always |
| 1196 |
# redistribute static route-map zone1-static-connect |
| 1197 |
# summary-address 198.51.100.128/27 tag 121 |
| 1198 |
# summary-address 198.51.100.160/27 |
| 1199 |
# vrf zone2 |
| 1200 |
# auto-cost reference-bandwidth 45 Gbps |
| 1201 |
|
| 1202 |
- name: >- |
| 1203 |
Replace device configurations of listed OSPF processes with provided |
| 1204 |
configurations |
| 1205 |
cisco.nxos.nxos_ospfv2: |
| 1206 |
config: |
| 1207 |
processes: |
| 1208 |
- process_id: 102 |
| 1209 |
router_id: 198.51.100.1 |
| 1210 |
areas: |
| 1211 |
- area_id: 0.0.0.100 |
| 1212 |
filter_list: |
| 1213 |
- route_map: rmap_8 |
| 1214 |
direction: in |
| 1215 |
ranges: |
| 1216 |
- prefix: 198.51.100.64/27 |
| 1217 |
not_advertise: true |
| 1218 |
- area_id: 0.0.0.101 |
| 1219 |
stub: |
| 1220 |
no_summary: true |
| 1221 |
redistribute: |
| 1222 |
- protocol: eigrp |
| 1223 |
id: 130 |
| 1224 |
route_map: rmap_1 |
| 1225 |
- protocol: direct |
| 1226 |
route_map: ospf102-direct-connect |
| 1227 |
vrfs: |
| 1228 |
- vrf: zone1 |
| 1229 |
router_id: 198.51.100.129 |
| 1230 |
redistribute: |
| 1231 |
- protocol: bgp |
| 1232 |
id: 65563 |
| 1233 |
route_map: zone1-bgp-connect |
| 1234 |
areas: |
| 1235 |
- area_id: 0.0.0.102 |
| 1236 |
nssa: |
| 1237 |
default_information_originate: true |
| 1238 |
no_summary: true |
| 1239 |
state: replaced |
| 1240 |
|
| 1241 |
|
| 1242 |
# Task output: |
| 1243 |
# ------------ |
| 1244 |
# before: |
| 1245 |
# processes: |
| 1246 |
# - process_id: "100" |
| 1247 |
# router_id: 203.0.113.20 |
| 1248 |
# - areas: |
| 1249 |
# - area_id: 0.0.0.100 |
| 1250 |
# filter_list: |
| 1251 |
# - direction: out |
| 1252 |
# route_map: rmap_2 |
| 1253 |
# - direction: in |
| 1254 |
# route_map: rmap_1 |
| 1255 |
# ranges: |
| 1256 |
# - not_advertise: true |
| 1257 |
# prefix: 198.51.100.64/27 |
| 1258 |
# - cost: 120 |
| 1259 |
# prefix: 198.51.100.96/27 |
| 1260 |
# - area_id: 0.0.0.101 |
| 1261 |
# authentication: |
| 1262 |
# message_digest: true |
| 1263 |
# process_id: "102" |
| 1264 |
# redistribute: |
| 1265 |
# - protocol: direct |
| 1266 |
# route_map: ospf102-direct-connect |
| 1267 |
# - id: "120" |
| 1268 |
# protocol: eigrp |
| 1269 |
# route_map: rmap_1 |
| 1270 |
# router_id: 198.51.100.1 |
| 1271 |
# vrfs: |
| 1272 |
# - areas: |
| 1273 |
# - area_id: 0.0.0.102 |
| 1274 |
# nssa: |
| 1275 |
# default_information_originate: true |
| 1276 |
# no_summary: true |
| 1277 |
# - area_id: 0.0.0.103 |
| 1278 |
# nssa: |
| 1279 |
# no_summary: true |
| 1280 |
# translate: |
| 1281 |
# type7: |
| 1282 |
# always: true |
| 1283 |
# redistribute: |
| 1284 |
# - protocol: static |
| 1285 |
# route_map: zone1-static-connect |
| 1286 |
# router_id: 198.51.100.129 |
| 1287 |
# vrf: zone1 |
| 1288 |
# - auto_cost: |
| 1289 |
# reference_bandwidth: 45 |
| 1290 |
# unit: Gbps |
| 1291 |
# vrf: zone2 |
| 1292 |
# |
| 1293 |
# commands: |
| 1294 |
# - router ospf 102 |
| 1295 |
# - redistribute eigrp 130 route-map rmap_1 |
| 1296 |
# - no redistribute eigrp 120 route-map rmap_1 |
| 1297 |
# - area 0.0.0.100 filter-list route-map rmap_8 in |
| 1298 |
# - no area 0.0.0.100 filter-list route-map rmap_2 out |
| 1299 |
# - no area 0.0.0.100 range 198.51.100.96/27 |
| 1300 |
# - no area 0.0.0.101 authentication |
| 1301 |
# - area 0.0.0.101 stub no-summary |
| 1302 |
# - vrf zone1 |
| 1303 |
# - no summary-address 198.51.100.128/27 tag 121 |
| 1304 |
# - no summary-address 198.51.100.160/27 |
| 1305 |
# - redistribute bgp 65563 route-map zone1-bgp-connect |
| 1306 |
# - no redistribute static route-map zone1-static-connect |
| 1307 |
# - no area 0.0.0.103 nssa |
| 1308 |
# - no area 0.0.0.103 nssa translate type7 always |
| 1309 |
# - no vrf zone2 |
| 1310 |
# |
| 1311 |
# after: |
| 1312 |
# processes: |
| 1313 |
# - process_id: "100" |
| 1314 |
# router_id: 203.0.113.20 |
| 1315 |
# - areas: |
| 1316 |
# - area_id: 0.0.0.101 |
| 1317 |
# stub: |
| 1318 |
# no_summary: true |
| 1319 |
# - area_id: 0.0.0.100 |
| 1320 |
# filter_list: |
| 1321 |
# - direction: in |
| 1322 |
# route_map: rmap_8 |
| 1323 |
# ranges: |
| 1324 |
# - not_advertise: true |
| 1325 |
# prefix: 198.51.100.64/27 |
| 1326 |
# process_id: "102" |
| 1327 |
# redistribute: |
| 1328 |
# - protocol: direct |
| 1329 |
# route_map: ospf102-direct-connect |
| 1330 |
# - id: "130" |
| 1331 |
# protocol: eigrp |
| 1332 |
# route_map: rmap_1 |
| 1333 |
# router_id: 198.51.100.1 |
| 1334 |
# vrfs: |
| 1335 |
# - areas: |
| 1336 |
# - area_id: 0.0.0.102 |
| 1337 |
# nssa: |
| 1338 |
# default_information_originate: true |
| 1339 |
# no_summary: true |
| 1340 |
# redistribute: |
| 1341 |
# - id: "65563" |
| 1342 |
# protocol: bgp |
| 1343 |
# route_map: zone1-bgp-connect |
| 1344 |
# router_id: 198.51.100.129 |
| 1345 |
# vrf: zone1 |
| 1346 |
|
| 1347 |
# After state: |
| 1348 |
# ------------ |
| 1349 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1350 |
# router ospf 100 |
| 1351 |
# router-id 203.0.113.20 |
| 1352 |
# router ospf 102 |
| 1353 |
# router-id 198.51.100.1 |
| 1354 |
# area 0.0.0.101 stub no-summary |
| 1355 |
# redistribute direct route-map ospf102-direct-connect |
| 1356 |
# redistribute eigrp 130 route-map rmap_1 |
| 1357 |
# area 0.0.0.100 filter-list route-map rmap_8 in |
| 1358 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1359 |
# vrf zone1 |
| 1360 |
# router-id 198.51.100.129 |
| 1361 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1362 |
# redistribute bgp 65563 route-map zone1-bgp-connect |
| 1363 |
|
| 1364 |
# Using overridden |
| 1365 |
|
| 1366 |
# Before state: |
| 1367 |
# ------------ |
| 1368 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1369 |
# router ospf 100 |
| 1370 |
# router-id 203.0.113.20 |
| 1371 |
# router ospf 102 |
| 1372 |
# router-id 198.51.100.1 |
| 1373 |
# redistribute direct route-map ospf102-direct-connect |
| 1374 |
# redistribute eigrp 120 route-map rmap_1 |
| 1375 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1376 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1377 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1378 |
# area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1379 |
# area 0.0.0.101 authentication message-digest |
| 1380 |
# vrf zone1 |
| 1381 |
# router-id 198.51.100.129 |
| 1382 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1383 |
# area 0.0.0.103 nssa no-summary |
| 1384 |
# area 0.0.0.103 nssa translate type7 always |
| 1385 |
# redistribute static route-map zone1-static-connect |
| 1386 |
# summary-address 198.51.100.128/27 tag 121 |
| 1387 |
# summary-address 198.51.100.160/27 |
| 1388 |
# vrf zone2 |
| 1389 |
# auto-cost reference-bandwidth 45 Gbps |
| 1390 |
|
| 1391 |
- name: Override all OSPF configuration with provided configuration |
| 1392 |
cisco.nxos.nxos_ospfv2: |
| 1393 |
config: |
| 1394 |
processes: |
| 1395 |
- process_id: 104 |
| 1396 |
router_id: 203.0.113.20 |
| 1397 |
- process_id: 102 |
| 1398 |
router_id: 198.51.100.1 |
| 1399 |
shutdown: true |
| 1400 |
state: overridden |
| 1401 |
|
| 1402 |
# Task output: |
| 1403 |
# ------------ |
| 1404 |
# before: |
| 1405 |
# processes: |
| 1406 |
# - process_id: "100" |
| 1407 |
# router_id: 203.0.113.20 |
| 1408 |
# - areas: |
| 1409 |
# - area_id: 0.0.0.100 |
| 1410 |
# filter_list: |
| 1411 |
# - direction: out |
| 1412 |
# route_map: rmap_2 |
| 1413 |
# - direction: in |
| 1414 |
# route_map: rmap_1 |
| 1415 |
# ranges: |
| 1416 |
# - not_advertise: true |
| 1417 |
# prefix: 198.51.100.64/27 |
| 1418 |
# - cost: 120 |
| 1419 |
# prefix: 198.51.100.96/27 |
| 1420 |
# - area_id: 0.0.0.101 |
| 1421 |
# authentication: |
| 1422 |
# message_digest: true |
| 1423 |
# process_id: "102" |
| 1424 |
# redistribute: |
| 1425 |
# - protocol: direct |
| 1426 |
# route_map: ospf102-direct-connect |
| 1427 |
# - id: "120" |
| 1428 |
# protocol: eigrp |
| 1429 |
# route_map: rmap_1 |
| 1430 |
# router_id: 198.51.100.1 |
| 1431 |
# vrfs: |
| 1432 |
# - areas: |
| 1433 |
# - area_id: 0.0.0.102 |
| 1434 |
# nssa: |
| 1435 |
# default_information_originate: true |
| 1436 |
# no_summary: true |
| 1437 |
# - area_id: 0.0.0.103 |
| 1438 |
# nssa: |
| 1439 |
# no_summary: true |
| 1440 |
# translate: |
| 1441 |
# type7: |
| 1442 |
# always: true |
| 1443 |
# redistribute: |
| 1444 |
# - protocol: static |
| 1445 |
# route_map: zone1-static-connect |
| 1446 |
# router_id: 198.51.100.129 |
| 1447 |
# vrf: zone1 |
| 1448 |
# - auto_cost: |
| 1449 |
# reference_bandwidth: 45 |
| 1450 |
# unit: Gbps |
| 1451 |
# vrf: zone2 |
| 1452 |
# |
| 1453 |
# commands: |
| 1454 |
# - no router ospf 100 |
| 1455 |
# - router ospf 104 |
| 1456 |
# - router-id 203.0.113.20 |
| 1457 |
# - router ospf 102 |
| 1458 |
# - shutdown |
| 1459 |
# - no redistribute direct route-map ospf102-direct-connect |
| 1460 |
# - no redistribute eigrp 120 route-map rmap_1 |
| 1461 |
# - no area 0.0.0.100 filter-list route-map rmap_2 out |
| 1462 |
# - no area 0.0.0.100 filter-list route-map rmap_1 in |
| 1463 |
# - no area 0.0.0.100 range 198.51.100.64/27 |
| 1464 |
# - no area 0.0.0.100 range 198.51.100.96/27 |
| 1465 |
# - no area 0.0.0.101 authentication |
| 1466 |
# - no vrf zone1 |
| 1467 |
# - no vrf zone2 |
| 1468 |
# |
| 1469 |
# after: |
| 1470 |
# processes: |
| 1471 |
# - process_id: "102" |
| 1472 |
# router_id: 198.51.100.1 |
| 1473 |
# shutdown: true |
| 1474 |
# - process_id: "104" |
| 1475 |
# router_id: 203.0.113.20 |
| 1476 |
|
| 1477 |
# After state: |
| 1478 |
# ------------ |
| 1479 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1480 |
# router ospf 102 |
| 1481 |
# router-id 198.51.100.1 |
| 1482 |
# shutdown |
| 1483 |
# router ospf 104 |
| 1484 |
# router-id 203.0.113.20 |
| 1485 |
|
| 1486 |
# Using deleted to delete a single OSPF process |
| 1487 |
|
| 1488 |
# Before state: |
| 1489 |
# ------------ |
| 1490 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1491 |
# router ospf 100 |
| 1492 |
# router-id 203.0.113.20 |
| 1493 |
# router ospf 102 |
| 1494 |
# router-id 198.51.100.1 |
| 1495 |
# redistribute direct route-map ospf102-direct-connect |
| 1496 |
# redistribute eigrp 120 route-map rmap_1 |
| 1497 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1498 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1499 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1500 |
# area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1501 |
# area 0.0.0.101 authentication message-digest |
| 1502 |
# vrf zone1 |
| 1503 |
# router-id 198.51.100.129 |
| 1504 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1505 |
# area 0.0.0.103 nssa no-summary |
| 1506 |
# area 0.0.0.103 nssa translate type7 always |
| 1507 |
# redistribute static route-map zone1-static-connect |
| 1508 |
# summary-address 198.51.100.128/27 tag 121 |
| 1509 |
# summary-address 198.51.100.160/27 |
| 1510 |
# vrf zone2 |
| 1511 |
# auto-cost reference-bandwidth 45 Gbps |
| 1512 |
|
| 1513 |
- name: Delete a single OSPF process |
| 1514 |
cisco.nxos.nxos_ospfv2: |
| 1515 |
config: |
| 1516 |
processes: |
| 1517 |
- process_id: 102 |
| 1518 |
state: deleted |
| 1519 |
|
| 1520 |
# Task output: |
| 1521 |
# ------------ |
| 1522 |
# before: |
| 1523 |
# processes: |
| 1524 |
# - process_id: "100" |
| 1525 |
# router_id: 203.0.113.20 |
| 1526 |
# - areas: |
| 1527 |
# - area_id: 0.0.0.100 |
| 1528 |
# filter_list: |
| 1529 |
# - direction: out |
| 1530 |
# route_map: rmap_2 |
| 1531 |
# - direction: in |
| 1532 |
# route_map: rmap_1 |
| 1533 |
# ranges: |
| 1534 |
# - not_advertise: true |
| 1535 |
# prefix: 198.51.100.64/27 |
| 1536 |
# - cost: 120 |
| 1537 |
# prefix: 198.51.100.96/27 |
| 1538 |
# - area_id: 0.0.0.101 |
| 1539 |
# authentication: |
| 1540 |
# message_digest: true |
| 1541 |
# process_id: "102" |
| 1542 |
# redistribute: |
| 1543 |
# - protocol: direct |
| 1544 |
# route_map: ospf102-direct-connect |
| 1545 |
# - id: "120" |
| 1546 |
# protocol: eigrp |
| 1547 |
# route_map: rmap_1 |
| 1548 |
# router_id: 198.51.100.1 |
| 1549 |
# vrfs: |
| 1550 |
# - areas: |
| 1551 |
# - area_id: 0.0.0.102 |
| 1552 |
# nssa: |
| 1553 |
# default_information_originate: true |
| 1554 |
# no_summary: true |
| 1555 |
# - area_id: 0.0.0.103 |
| 1556 |
# nssa: |
| 1557 |
# no_summary: true |
| 1558 |
# translate: |
| 1559 |
# type7: |
| 1560 |
# always: true |
| 1561 |
# redistribute: |
| 1562 |
# - protocol: static |
| 1563 |
# route_map: zone1-static-connect |
| 1564 |
# router_id: 198.51.100.129 |
| 1565 |
# vrf: zone1 |
| 1566 |
# - auto_cost: |
| 1567 |
# reference_bandwidth: 45 |
| 1568 |
# unit: Gbps |
| 1569 |
# vrf: zone2 |
| 1570 |
# |
| 1571 |
# commands: |
| 1572 |
# - no router ospf 102 |
| 1573 |
# |
| 1574 |
# after: |
| 1575 |
# processes: |
| 1576 |
# - process_id: "100" |
| 1577 |
# router_id: 203.0.113.20 |
| 1578 |
|
| 1579 |
# After state: |
| 1580 |
# ------------ |
| 1581 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1582 |
# router ospf 100 |
| 1583 |
# router-id 203.0.113.20 |
| 1584 |
|
| 1585 |
# Using deleted all OSPF processes from the device |
| 1586 |
|
| 1587 |
# Before state: |
| 1588 |
# ------------ |
| 1589 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1590 |
# router ospf 100 |
| 1591 |
# router-id 203.0.113.20 |
| 1592 |
# router ospf 102 |
| 1593 |
# router-id 198.51.100.1 |
| 1594 |
# redistribute direct route-map ospf102-direct-connect |
| 1595 |
# redistribute eigrp 120 route-map rmap_1 |
| 1596 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1597 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1598 |
# area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1599 |
# area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1600 |
# area 0.0.0.101 authentication message-digest |
| 1601 |
# vrf zone1 |
| 1602 |
# router-id 198.51.100.129 |
| 1603 |
# area 0.0.0.102 nssa no-summary default-information-originate |
| 1604 |
# area 0.0.0.103 nssa no-summary |
| 1605 |
# area 0.0.0.103 nssa translate type7 always |
| 1606 |
# redistribute static route-map zone1-static-connect |
| 1607 |
# summary-address 198.51.100.128/27 tag 121 |
| 1608 |
# summary-address 198.51.100.160/27 |
| 1609 |
# vrf zone2 |
| 1610 |
# auto-cost reference-bandwidth 45 Gbps |
| 1611 |
|
| 1612 |
- name: Delete all OSPF processes from the device |
| 1613 |
cisco.nxos.nxos_ospfv2: |
| 1614 |
state: deleted |
| 1615 |
|
| 1616 |
# Task output: |
| 1617 |
# ------------ |
| 1618 |
# before: |
| 1619 |
# processes: |
| 1620 |
# - process_id: "100" |
| 1621 |
# router_id: 203.0.113.20 |
| 1622 |
# - areas: |
| 1623 |
# - area_id: 0.0.0.100 |
| 1624 |
# filter_list: |
| 1625 |
# - direction: out |
| 1626 |
# route_map: rmap_2 |
| 1627 |
# - direction: in |
| 1628 |
# route_map: rmap_1 |
| 1629 |
# ranges: |
| 1630 |
# - not_advertise: true |
| 1631 |
# prefix: 198.51.100.64/27 |
| 1632 |
# - cost: 120 |
| 1633 |
# prefix: 198.51.100.96/27 |
| 1634 |
# - area_id: 0.0.0.101 |
| 1635 |
# authentication: |
| 1636 |
# message_digest: true |
| 1637 |
# process_id: "102" |
| 1638 |
# redistribute: |
| 1639 |
# - protocol: direct |
| 1640 |
# route_map: ospf102-direct-connect |
| 1641 |
# - id: "120" |
| 1642 |
# protocol: eigrp |
| 1643 |
# route_map: rmap_1 |
| 1644 |
# router_id: 198.51.100.1 |
| 1645 |
# vrfs: |
| 1646 |
# - areas: |
| 1647 |
# - area_id: 0.0.0.102 |
| 1648 |
# nssa: |
| 1649 |
# default_information_originate: true |
| 1650 |
# no_summary: true |
| 1651 |
# - area_id: 0.0.0.103 |
| 1652 |
# nssa: |
| 1653 |
# no_summary: true |
| 1654 |
# translate: |
| 1655 |
# type7: |
| 1656 |
# always: true |
| 1657 |
# redistribute: |
| 1658 |
# - protocol: static |
| 1659 |
# route_map: zone1-static-connect |
| 1660 |
# router_id: 198.51.100.129 |
| 1661 |
# vrf: zone1 |
| 1662 |
# - auto_cost: |
| 1663 |
# reference_bandwidth: 45 |
| 1664 |
# unit: Gbps |
| 1665 |
# vrf: zone2 |
| 1666 |
# |
| 1667 |
# commands: |
| 1668 |
# - no router ospf 100 |
| 1669 |
# - no router ospf 102 |
| 1670 |
# |
| 1671 |
# after: {} |
| 1672 |
|
| 1673 |
# After state: |
| 1674 |
# ------------ |
| 1675 |
# nxos-9k-rdo# sh running-config | section "^router ospf .*" |
| 1676 |
# nxos-9k-rdo# |
| 1677 |
|
| 1678 |
# Using rendered |
| 1679 |
|
| 1680 |
- name: >- |
| 1681 |
Render platform specific configuration lines (without connecting to the |
| 1682 |
device) |
| 1683 |
cisco.nxos.nxos_ospfv2: |
| 1684 |
config: |
| 1685 |
processes: |
| 1686 |
- process_id: 100 |
| 1687 |
router_id: 203.0.113.20 |
| 1688 |
- process_id: 102 |
| 1689 |
router_id: 198.51.100.1 |
| 1690 |
areas: |
| 1691 |
- area_id: 0.0.0.100 |
| 1692 |
filter_list: |
| 1693 |
- route_map: rmap_1 |
| 1694 |
direction: in |
| 1695 |
- route_map: rmap_2 |
| 1696 |
direction: out |
| 1697 |
ranges: |
| 1698 |
- prefix: 198.51.100.64/27 |
| 1699 |
not_advertise: true |
| 1700 |
- prefix: 198.51.100.96/27 |
| 1701 |
cost: 120 |
| 1702 |
- area_id: 0.0.0.101 |
| 1703 |
authentication: |
| 1704 |
message_digest: true |
| 1705 |
redistribute: |
| 1706 |
- protocol: eigrp |
| 1707 |
id: 120 |
| 1708 |
route_map: rmap_1 |
| 1709 |
- protocol: direct |
| 1710 |
route_map: ospf102-direct-connect |
| 1711 |
vrfs: |
| 1712 |
- vrf: zone1 |
| 1713 |
router_id: 198.51.100.129 |
| 1714 |
redistribute: |
| 1715 |
- protocol: static |
| 1716 |
route_map: zone1-static-connect |
| 1717 |
summary_address: |
| 1718 |
- prefix: 198.51.100.128/27 |
| 1719 |
tag: 121 |
| 1720 |
- prefix: 198.51.100.160/27 |
| 1721 |
areas: |
| 1722 |
- area_id: 0.0.0.102 |
| 1723 |
nssa: |
| 1724 |
default_information_originate: true |
| 1725 |
no_summary: true |
| 1726 |
- area_id: 0.0.0.103 |
| 1727 |
nssa: |
| 1728 |
no_summary: true |
| 1729 |
translate: |
| 1730 |
type7: |
| 1731 |
always: true |
| 1732 |
- vrf: zone2 |
| 1733 |
auto_cost: |
| 1734 |
reference_bandwidth: 45 |
| 1735 |
unit: Gbps |
| 1736 |
state: rendered |
| 1737 |
|
| 1738 |
|
| 1739 |
# Task output: |
| 1740 |
# ------------ |
| 1741 |
# rendered: |
| 1742 |
# - router ospf 100 |
| 1743 |
# - router-id 203.0.113.20 |
| 1744 |
# - router ospf 102 |
| 1745 |
# - router-id 198.51.100.1 |
| 1746 |
# - redistribute eigrp 120 route-map rmap_1 |
| 1747 |
# - redistribute direct route-map ospf102-direct-connect |
| 1748 |
# - area 0.0.0.100 filter-list route-map rmap_1 in |
| 1749 |
# - area 0.0.0.100 filter-list route-map rmap_2 out |
| 1750 |
# - area 0.0.0.100 range 198.51.100.64/27 not-advertise |
| 1751 |
# - area 0.0.0.100 range 198.51.100.96/27 cost 120 |
| 1752 |
# - area 0.0.0.101 authentication message-digest |
| 1753 |
# - vrf zone1 |
| 1754 |
# - router-id 198.51.100.129 |
| 1755 |
# - summary-address 198.51.100.128/27 tag 121 |
| 1756 |
# - summary-address 198.51.100.160/27 |
| 1757 |
# - redistribute static route-map zone1-static-connect |
| 1758 |
# - area 0.0.0.102 nssa no-summary default-information-originate |
| 1759 |
# - area 0.0.0.103 nssa no-summary |
| 1760 |
# - area 0.0.0.103 nssa translate type7 always |
| 1761 |
# - vrf zone2 |
| 1762 |
# - auto-cost reference-bandwidth 45 Gbps |
| 1763 |
|
| 1764 |
# Using parsed |
| 1765 |
|
| 1766 |
# parsed.cfg |
| 1767 |
# ------------ |
| 1768 |
# router ospf 100 |
| 1769 |
# router-id 192.0.100.1 |
| 1770 |
# area 0.0.0.101 nssa no-summary no-redistribution |
| 1771 |
# area 0.0.0.102 stub no-summary |
| 1772 |
# redistribute direct route-map ospf-direct-connect |
| 1773 |
# redistribute eigrp 120 route-map rmap_1 |
| 1774 |
# area 0.0.0.100 filter-list route-map rmap_2 out |
| 1775 |
# area 0.0.0.100 filter-list route-map rmap_1 in |
| 1776 |
# area 0.0.0.100 range 192.0.2.0/24 not-advertise |
| 1777 |
# area 0.0.0.100 range 192.0.3.0/24 cost 120 |
| 1778 |
# area 0.0.0.100 authentication message-digest |
| 1779 |
# vrf zone1 |
| 1780 |
# router-id 192.0.100.2 |
| 1781 |
# area 0.0.100.1 nssa no-summary no-redistribution |
| 1782 |
# redistribute static route-map zone1-direct-connect |
| 1783 |
# summary-address 10.0.0.0/24 tag 120 |
| 1784 |
# summary-address 11.0.0.0/24 not-advertise |
| 1785 |
# vrf zone2 |
| 1786 |
# auto-cost reference-bandwidth 45 Gbps |
| 1787 |
# down-bit-ignore |
| 1788 |
# capability vrf-lite evpn |
| 1789 |
# shutdown |
| 1790 |
# router ospf 102 |
| 1791 |
# router-id 198.54.100.1 |
| 1792 |
# shutdown |
| 1793 |
# vrf zone2 |
| 1794 |
# summary-address 192.0.8.0/24 tag 120 |
| 1795 |
# vrf zone4 |
| 1796 |
# shutdown |
| 1797 |
|
| 1798 |
- name: Parse externally provided OSPFv2 config |
| 1799 |
cisco.nxos.nxos_ospfv2: |
| 1800 |
running_config: "{{ lookup('file', 'ospfv2.cfg') }}" |
| 1801 |
state: parsed |
| 1802 |
|
| 1803 |
# Task output: |
| 1804 |
# ------------ |
| 1805 |
# parsed: |
| 1806 |
# processes: |
| 1807 |
# - process_id: "100" |
| 1808 |
# areas: |
| 1809 |
# - area_id: 0.0.0.101 |
| 1810 |
# nssa: |
| 1811 |
# no_redistribution: true |
| 1812 |
# no_summary: true |
| 1813 |
# - area_id: 0.0.0.102 |
| 1814 |
# stub: |
| 1815 |
# no_summary: true |
| 1816 |
# - area_id: 0.0.0.100 |
| 1817 |
# authentication: |
| 1818 |
# message_digest: true |
| 1819 |
# filter_list: |
| 1820 |
# - direction: out |
| 1821 |
# route_map: rmap_2 |
| 1822 |
# - direction: in |
| 1823 |
# route_map: rmap_1 |
| 1824 |
# ranges: |
| 1825 |
# - not_advertise: true |
| 1826 |
# prefix: 192.0.2.0/24 |
| 1827 |
# - cost: 120 |
| 1828 |
# prefix: 192.0.3.0/24 |
| 1829 |
# redistribute: |
| 1830 |
# - protocol: direct |
| 1831 |
# route_map: ospf-direct-connect |
| 1832 |
# - id: "120" |
| 1833 |
# protocol: eigrp |
| 1834 |
# route_map: rmap_1 |
| 1835 |
# router_id: 192.0.100.1 |
| 1836 |
# vrfs: |
| 1837 |
# - vrf: zone1 |
| 1838 |
# areas: |
| 1839 |
# - area_id: 0.0.100.1 |
| 1840 |
# nssa: |
| 1841 |
# no_redistribution: true |
| 1842 |
# no_summary: true |
| 1843 |
# redistribute: |
| 1844 |
# - protocol: static |
| 1845 |
# route_map: zone1-direct-connect |
| 1846 |
# router_id: 192.0.100.2 |
| 1847 |
# summary_address: |
| 1848 |
# - prefix: 10.0.0.0/24 |
| 1849 |
# tag: 120 |
| 1850 |
# - not_advertise: true |
| 1851 |
# prefix: 11.0.0.0/24 |
| 1852 |
# - vrf: zone2 |
| 1853 |
# auto_cost: |
| 1854 |
# reference_bandwidth: 45 |
| 1855 |
# unit: Gbps |
| 1856 |
# capability: |
| 1857 |
# vrf_lite: |
| 1858 |
# evpn: true |
| 1859 |
# down_bit_ignore: true |
| 1860 |
# shutdown: true |
| 1861 |
# - process_id: "102" |
| 1862 |
# router_id: 198.54.100.1 |
| 1863 |
# shutdown: true |
| 1864 |
# vrfs: |
| 1865 |
# - vrf: zone2 |
| 1866 |
# summary_address: |
| 1867 |
# - prefix: 192.0.8.0/24 |
| 1868 |
# tag: 120 |
| 1869 |
# - vrf: zone4 |
| 1870 |
# shutdown: true |
| 1871 |
|
| 1872 |
# Using gathered |
| 1873 |
|
| 1874 |
- name: Gather OSPFv2 facts using gathered |
| 1875 |
cisco.nxos.nxos_ospfv2: |
| 1876 |
state: gathered |
| 1877 |
|
| 1878 |
# Task output: |
| 1879 |
# ------------ |
| 1880 |
# gathered: |
| 1881 |
# processes: |
| 1882 |
# - process_id: "102" |
| 1883 |
# areas: |
| 1884 |
# - area_id: 0.0.0.101 |
| 1885 |
# stub: |
| 1886 |
# no_summary: true |
| 1887 |
# - area_id: 0.0.0.100 |
| 1888 |
# filter_list: |
| 1889 |
# - direction: in |
| 1890 |
# route_map: rmap_8 |
| 1891 |
# ranges: |
| 1892 |
# - not_advertise: true |
| 1893 |
# prefix: 198.51.100.64/27 |
| 1894 |
# redistribute: |
| 1895 |
# - protocol: direct |
| 1896 |
# route_map: ospf102-direct-connect |
| 1897 |
# - id: "130" |
| 1898 |
# protocol: eigrp |
| 1899 |
# route_map: rmap_1 |
| 1900 |
# router_id: 198.51.100.1 |
| 1901 |
# vrfs: |
| 1902 |
# - vrf: zone1 |
| 1903 |
# areas: |
| 1904 |
# - area_id: 0.0.0.102 |
| 1905 |
# nssa: |
| 1906 |
# default_information_originate: true |
| 1907 |
# no_summary: true |
| 1908 |
# redistribute: |
| 1909 |
# - id: "65563" |
| 1910 |
# protocol: bgp |
| 1911 |
# route_map: zone1-bgp-connect |
| 1912 |
# router_id: 198.51.100.129 |
| 1913 |
# |
| 1914 |
""" |
| 1915 |
RETURN = """ |
| 1916 |
before: |
| 1917 |
description: The configuration prior to the model invocation. |
| 1918 |
returned: always |
| 1919 |
type: dict |
| 1920 |
sample: > |
| 1921 |
The configuration returned will always be in the same format |
| 1922 |
of the parameters above. |
| 1923 |
after: |
| 1924 |
description: The resulting configuration model invocation. |
| 1925 |
returned: when changed |
| 1926 |
type: dict |
| 1927 |
sample: > |
| 1928 |
The configuration returned will always be in the same format |
| 1929 |
of the parameters above. |
| 1930 |
commands: |
| 1931 |
description: The set of commands pushed to the remote device. |
| 1932 |
returned: always |
| 1933 |
type: list |
| 1934 |
sample: |
| 1935 |
- "router ospf 102" |
| 1936 |
- "router-id 198.54.100.1" |
| 1937 |
- "router ospf 100" |
| 1938 |
- "router-id 192.0.100.1" |
| 1939 |
- "redistribute eigrp 120 route-map rmap_1" |
| 1940 |
- "redistribute direct route-map ospf-direct-connect" |
| 1941 |
- "area 0.0.0.100 filter-list route-map rmap_1 in" |
| 1942 |
- "area 0.0.0.100 filter-list route-map rmap_2 out" |
| 1943 |
- "area 0.0.0.100 range 192.0.2.0/24 not-advertise" |
| 1944 |
- "area 0.0.0.100 range 192.0.3.0/24 cost 120" |
| 1945 |
- "vrf zone1" |
| 1946 |
- "router-id 192.0.100.2" |
| 1947 |
- "summary-address 10.0.0.0/24 tag 121" |
| 1948 |
- "summary-address 11.0.0.0/24" |
| 1949 |
- "redistribute static route-map zone1-direct-connect" |
| 1950 |
- "vrf zone2" |
| 1951 |
- "auto-cost reference-bandwidth 45 Gbps" |
| 1952 |
- "capability vrf-lite evpn" |
| 1953 |
rendered: |
| 1954 |
description: The provided configuration in the task rendered in device-native format (offline). |
| 1955 |
returned: when I(state) is C(rendered) |
| 1956 |
type: list |
| 1957 |
sample: |
| 1958 |
- "router ospf 102" |
| 1959 |
- "router-id 198.54.100.1" |
| 1960 |
- "router ospf 100" |
| 1961 |
gathered: |
| 1962 |
description: Facts about the network resource gathered from the remote device as structured data. |
| 1963 |
returned: when I(state) is C(gathered) |
| 1964 |
type: dict |
| 1965 |
sample: > |
| 1966 |
This output will always be in the same format as the |
| 1967 |
module argspec. |
| 1968 |
parsed: |
| 1969 |
description: The device native config provided in I(running_config) option parsed into structured data as per module argspec. |
| 1970 |
returned: when I(state) is C(parsed) |
| 1971 |
type: dict |
| 1972 |
sample: > |
| 1973 |
This output will always be in the same format as the |
| 1974 |
module argspec. |
| 1975 |
""" |
| 1976 |
|
| 1977 |
|
| 1978 |
from ansible.module_utils.basic import AnsibleModule |
| 1979 |
|
| 1980 |
from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.argspec.ospfv2.ospfv2 import ( |
| 1981 |
Ospfv2Args, |
| 1982 |
) |
| 1983 |
from ansible_collections.cisco.nxos.plugins.module_utils.network.nxos.config.ospfv2.ospfv2 import ( |
| 1984 |
Ospfv2, |
| 1985 |
) |
| 1986 |
|
| 1987 |
|
| 1988 |
def main(): |
| 1989 |
""" |
| 1990 |
Main entry point for module execution |
| 1991 |
|
| 1992 |
:returns: the result form module invocation |
| 1993 |
""" |
| 1994 |
required_if = [ |
| 1995 |
("state", "merged", ("config",)), |
| 1996 |
("state", "replaced", ("config",)), |
| 1997 |
("state", "overridden", ("config",)), |
| 1998 |
("state", "rendered", ("config",)), |
| 1999 |
("state", "parsed", ("running_config",)), |
| 2000 |
] |
| 2001 |
module = AnsibleModule( |
| 2002 |
argument_spec=Ospfv2Args.argument_spec, |
| 2003 |
required_if=required_if, |
| 2004 |
supports_check_mode=True, |
| 2005 |
) |
| 2006 |
|
| 2007 |
result = Ospfv2(module).execute_module() |
| 2008 |
module.exit_json(**result) |
| 2009 |
|
| 2010 |
|
| 2011 |
if __name__ == "__main__": |
| 2012 |
main() |