| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
# Copyright 2021 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 |
The module file for iosxr_bgp_global |
| 9 |
""" |
| 10 |
|
| 11 |
from __future__ import absolute_import, division, print_function |
| 12 |
|
| 13 |
|
| 14 |
__metaclass__ = type |
| 15 |
|
| 16 |
DOCUMENTATION = """ |
| 17 |
module: iosxr_bgp_global |
| 18 |
short_description: Resource module to configure BGP. |
| 19 |
description: |
| 20 |
- This module configures and manages the attributes of BGP global on Cisco IOS-XR platforms. |
| 21 |
version_added: 2.0.0 |
| 22 |
author: Ashwini Mhatre (@amhatre) |
| 23 |
notes: |
| 24 |
- This module works with connection C(network_cli). |
| 25 |
options: |
| 26 |
config: |
| 27 |
description: A list of configurations for BGP global. |
| 28 |
type: dict |
| 29 |
suboptions: |
| 30 |
as_number: |
| 31 |
description: Autonomous system number of the router. |
| 32 |
type: str |
| 33 |
bfd: &bfd |
| 34 |
description: Configure BFD parameters. |
| 35 |
type: dict |
| 36 |
suboptions: |
| 37 |
minimum_interval: &min_interval |
| 38 |
description: Specifies the BFD session's minimum-interval value for the neighbor. |
| 39 |
type: int |
| 40 |
multiplier: &multiplier |
| 41 |
description: Specifies the BFD session's multiplier value for the neighbor. |
| 42 |
type: int |
| 43 |
bgp: &bgp |
| 44 |
description: BGP parameters. |
| 45 |
type: dict |
| 46 |
suboptions: |
| 47 |
as_path_loopcheck: |
| 48 |
description: Enable AS-path loop checking for iBGP peers. |
| 49 |
type: bool |
| 50 |
auto_policy_soft_reset: &auto_policy_soft_reset |
| 51 |
description: Enable automatic soft peer reset on policy reconfiguration. |
| 52 |
type: dict |
| 53 |
suboptions: |
| 54 |
disable: |
| 55 |
description: Disable an automatic soft reset of Border Gateway Protocol (BGP) peers. |
| 56 |
type: bool |
| 57 |
bestpath: &bestpath |
| 58 |
description: Select the bestpath selection algorithim for BGP routes. |
| 59 |
type: dict |
| 60 |
suboptions: |
| 61 |
as_path: |
| 62 |
description: Select the bestpath selection based on as-path. |
| 63 |
type: dict |
| 64 |
suboptions: |
| 65 |
ignore: |
| 66 |
description: ignore |
| 67 |
type: bool |
| 68 |
multipath_relax: |
| 69 |
description: multipath-relax |
| 70 |
type: bool |
| 71 |
aigp: |
| 72 |
description: AIGP attribute |
| 73 |
type: dict |
| 74 |
suboptions: |
| 75 |
ignore: |
| 76 |
description: Ignore AIGP attribute. |
| 77 |
type: bool |
| 78 |
med: |
| 79 |
description: MED attribute |
| 80 |
type: dict |
| 81 |
suboptions: |
| 82 |
always: |
| 83 |
description: Allow comparing MED from different neighbors. |
| 84 |
type: bool |
| 85 |
confed: |
| 86 |
description: Compare MED among confederation paths. |
| 87 |
type: bool |
| 88 |
missing_as_worst: |
| 89 |
description: Treat missing MED as the least preferred one. |
| 90 |
type: bool |
| 91 |
compare_routerid: |
| 92 |
description: Compare router-id for identical EBGP paths. |
| 93 |
type: bool |
| 94 |
cost_community: |
| 95 |
description: Cost community. |
| 96 |
type: dict |
| 97 |
suboptions: |
| 98 |
ignore: |
| 99 |
description: ignore cost_community |
| 100 |
type: bool |
| 101 |
origin_as: |
| 102 |
description: BGP origin-AS knobs. |
| 103 |
type: dict |
| 104 |
suboptions: |
| 105 |
use: |
| 106 |
description: BGP origin-AS knobs. |
| 107 |
type: dict |
| 108 |
suboptions: |
| 109 |
validity: |
| 110 |
description: BGP bestpath selection will use origin-AS validity |
| 111 |
type: bool |
| 112 |
allow: |
| 113 |
description: BGP origin-AS knobs. |
| 114 |
type: dict |
| 115 |
suboptions: |
| 116 |
invalid: |
| 117 |
description: BGP bestpath selection will allow 'invalid' origin-AS |
| 118 |
type: bool |
| 119 |
cluster_id: &cluster_id |
| 120 |
description: Cluster ID of this router acting as a route reflector. |
| 121 |
type: str |
| 122 |
confederation: &confederation |
| 123 |
description: confederation. |
| 124 |
type: dict |
| 125 |
suboptions: |
| 126 |
identifier: |
| 127 |
description: Set routing domain confederation AS. |
| 128 |
type: int |
| 129 |
peers: |
| 130 |
description: Enter peer ASs in BGP confederation mode. |
| 131 |
type: list |
| 132 |
elements: int |
| 133 |
default: &default |
| 134 |
description: Configure default value. |
| 135 |
type: dict |
| 136 |
suboptions: |
| 137 |
local_preference: |
| 138 |
description: |
| 139 |
- local preferance. |
| 140 |
- Please refer vendor documentation for valid values |
| 141 |
type: int |
| 142 |
enforce_first_as: &enforce_first_as |
| 143 |
description: Enforce the first AS for EBGP routes |
| 144 |
type: dict |
| 145 |
suboptions: |
| 146 |
disable: |
| 147 |
description: disable enforce 1st as |
| 148 |
type: bool |
| 149 |
fast_external_fallover: &fast_external_fallover |
| 150 |
description: Immediately reset session if a link to a directly connected external peer goes down. |
| 151 |
type: dict |
| 152 |
suboptions: |
| 153 |
disable: |
| 154 |
description: disable fast external fallover. |
| 155 |
type: bool |
| 156 |
graceful_restart: |
| 157 |
description: Enable graceful restart support. |
| 158 |
type: dict |
| 159 |
suboptions: |
| 160 |
set: |
| 161 |
description: Enable graceful-restart. |
| 162 |
type: bool |
| 163 |
graceful_reset: |
| 164 |
description: Reset gracefully if configuration change forces a peer reset. |
| 165 |
type: bool |
| 166 |
restart_time: &restart_time |
| 167 |
description: Restart time advertised to neighbors in seconds <1-4095>. |
| 168 |
type: int |
| 169 |
purge_time: |
| 170 |
description: Time before stale routes are purged in seconds <1-6000>. |
| 171 |
type: int |
| 172 |
stalepath_time: &stalepath_time |
| 173 |
description: Maximum time to wait for restart of GR capable peers in seconds <1-4095>. |
| 174 |
type: int |
| 175 |
install: |
| 176 |
description: Install diversion path to RIB/CEF. |
| 177 |
type: dict |
| 178 |
suboptions: |
| 179 |
diversion: |
| 180 |
description: Install diversion path to RIB/CEF. |
| 181 |
type: bool |
| 182 |
log: &bgp_log |
| 183 |
description: Log bgp info |
| 184 |
type: dict |
| 185 |
suboptions: |
| 186 |
log_message: |
| 187 |
description: Log neighbor inbound/outbound message. |
| 188 |
type: dict |
| 189 |
suboptions: |
| 190 |
disable: |
| 191 |
description: disable inbound outbound messages. |
| 192 |
type: bool |
| 193 |
neighbor: |
| 194 |
description: Log neighbor state info. |
| 195 |
type: dict |
| 196 |
suboptions: |
| 197 |
changes: |
| 198 |
description: Log neighbor up/down and reset reason. |
| 199 |
type: dict |
| 200 |
suboptions: |
| 201 |
detail: |
| 202 |
type: bool |
| 203 |
description: detail |
| 204 |
disable: |
| 205 |
type: bool |
| 206 |
description: disable |
| 207 |
maximum: |
| 208 |
description: Maximum number of neighbors that can be configured |
| 209 |
type: dict |
| 210 |
suboptions: |
| 211 |
neighbor: |
| 212 |
description: Maximum number of neighbors <1-15000>. |
| 213 |
type: int |
| 214 |
multipath: &multipath |
| 215 |
description: Change multipath selection criteria |
| 216 |
type: dict |
| 217 |
suboptions: |
| 218 |
as_path: |
| 219 |
description: AS path |
| 220 |
type: dict |
| 221 |
suboptions: |
| 222 |
ignore: |
| 223 |
description: Ignore as-path related check for multipath selection. |
| 224 |
type: dict |
| 225 |
suboptions: |
| 226 |
onwards: |
| 227 |
description: Ignore everything onwards as-path for multipath selection. |
| 228 |
type: bool |
| 229 |
origin_as: |
| 230 |
description: BGP origin-AS knobs. |
| 231 |
type: dict |
| 232 |
suboptions: |
| 233 |
validation: |
| 234 |
description: BGP origin-AS validation knobs. |
| 235 |
type: dict |
| 236 |
suboptions: |
| 237 |
disable: |
| 238 |
description: Disable RPKI origin-AS validation. |
| 239 |
type: bool |
| 240 |
signal: |
| 241 |
description: Signal origin-AS validity towards peers. |
| 242 |
type: dict |
| 243 |
suboptions: |
| 244 |
ibgp: |
| 245 |
description: Signal origin-AS validity towards iBGP peers |
| 246 |
type: bool |
| 247 |
time: |
| 248 |
description: Time to wait between an RPKI update and a BGP table walk. |
| 249 |
type: dict |
| 250 |
suboptions: |
| 251 |
time_off: |
| 252 |
description: No automatic prefix validation after an RPKI update. |
| 253 |
type: bool |
| 254 |
time_in_second: |
| 255 |
description: Prefix validation time (in seconds). |
| 256 |
type: int |
| 257 |
redistribute_internal: &redistribute_internal |
| 258 |
description: Redistribute internal BGP routes. |
| 259 |
type: bool |
| 260 |
router_id: &router_id |
| 261 |
description: Configure Router-id. Example- A.B.C.D IPv4 address. |
| 262 |
type: str |
| 263 |
scan_time: |
| 264 |
description: Configure background scanner interval for generic scanner Example- <5-3600>. |
| 265 |
type: int |
| 266 |
unsafe_ebgp_policy: &ebgp_policy |
| 267 |
description: Make eBGP neighbors with no policy pass all routes(cisco-support). |
| 268 |
type: bool |
| 269 |
update_delay: |
| 270 |
description: Set the max initial delay for sending updates Example-<0-3600> in secs. |
| 271 |
type: int |
| 272 |
default_information: &default_info |
| 273 |
description: Control distribution of default information. |
| 274 |
type: dict |
| 275 |
suboptions: |
| 276 |
originate: |
| 277 |
description: Distribute a default route |
| 278 |
type: bool |
| 279 |
default_metric: &default_metric |
| 280 |
description: Default metric. Example-<1-4294967295>. |
| 281 |
type: int |
| 282 |
graceful_maintenance: |
| 283 |
description: This allows the router to be brought in or out of service gracefully. |
| 284 |
type: dict |
| 285 |
suboptions: |
| 286 |
activate: |
| 287 |
description: All neighbors with graceful-maintenance config |
| 288 |
type: str |
| 289 |
choices: [ 'all-neighbors','retain-routes','all-neighbors retain-routes', '' ] |
| 290 |
ibgp: |
| 291 |
description: Set options for iBGP peers. |
| 292 |
type: dict |
| 293 |
suboptions: |
| 294 |
policy: |
| 295 |
description: Set options for route-policy. |
| 296 |
type: dict |
| 297 |
suboptions: |
| 298 |
out: |
| 299 |
description: Set options for outbound policy. |
| 300 |
type: dict |
| 301 |
suboptions: |
| 302 |
enforce_modifications: |
| 303 |
description: Allow policy to modify all attributes. |
| 304 |
type: bool |
| 305 |
mpls: &mpls |
| 306 |
description: Enable mpls parameters. |
| 307 |
type: dict |
| 308 |
suboptions: |
| 309 |
activate: |
| 310 |
description: Enter mpls interfaces in BGP mpls activate mode. |
| 311 |
type: dict |
| 312 |
suboptions: |
| 313 |
interface: |
| 314 |
description: Name of interface to enable mpls. |
| 315 |
type: str |
| 316 |
mvpn: |
| 317 |
description: Connect to PIM/PIM6. |
| 318 |
type: bool |
| 319 |
neighbors: &neighbors |
| 320 |
description: Specify a neighbor router. |
| 321 |
type: list |
| 322 |
elements: dict |
| 323 |
suboptions: |
| 324 |
neighbor_address: |
| 325 |
description: |
| 326 |
- Neighbor router address. |
| 327 |
type: str |
| 328 |
aliases: |
| 329 |
- neighbor |
| 330 |
required: true |
| 331 |
advertisement_interval: |
| 332 |
description: Minimum interval between sending BGP routing updates.Example-<0-600>. |
| 333 |
type: int |
| 334 |
bfd: |
| 335 |
description: Configure BFD parameters. |
| 336 |
type: dict |
| 337 |
suboptions: |
| 338 |
fast_detect: |
| 339 |
description: Enable Fast detection |
| 340 |
type: dict |
| 341 |
suboptions: |
| 342 |
set: |
| 343 |
description: set fast-detect |
| 344 |
type: bool |
| 345 |
disable: |
| 346 |
description: Prevent bfd settings from being inherited from the parent. |
| 347 |
type: bool |
| 348 |
strict_mode: |
| 349 |
description: Hold down neighbor session until BFD session is up |
| 350 |
type: bool |
| 351 |
multiplier: *multiplier |
| 352 |
minimum_interval: *min_interval |
| 353 |
bmp_activate: &bmp_activate |
| 354 |
description: Enable BMP logging for this neighbor. |
| 355 |
type: dict |
| 356 |
suboptions: |
| 357 |
server: |
| 358 |
description: Enable BMP connection to particular server.Example-<1-8>. |
| 359 |
type: int |
| 360 |
capability: &capability |
| 361 |
description: Advertise capability to the peer. |
| 362 |
type: dict |
| 363 |
suboptions: |
| 364 |
additional_paths: |
| 365 |
description: BGP additional-paths commands. |
| 366 |
type: dict |
| 367 |
suboptions: |
| 368 |
send: |
| 369 |
type: dict |
| 370 |
description: Additional paths Send capability |
| 371 |
suboptions: |
| 372 |
set: |
| 373 |
type: bool |
| 374 |
description: set send capability |
| 375 |
disable: |
| 376 |
type: bool |
| 377 |
description: set send capability |
| 378 |
receive: |
| 379 |
type: dict |
| 380 |
description: Additional paths receive capability |
| 381 |
suboptions: |
| 382 |
set: |
| 383 |
type: bool |
| 384 |
description: set receive capability |
| 385 |
disable: |
| 386 |
type: bool |
| 387 |
description: set receive capability |
| 388 |
suppress: |
| 389 |
description: Suppress advertising capability to the peer. |
| 390 |
type: dict |
| 391 |
suboptions: |
| 392 |
four_byte_AS: |
| 393 |
description: 4-byte-as capability |
| 394 |
type: dict |
| 395 |
suboptions: |
| 396 |
set: |
| 397 |
description: set 4_byte_as. |
| 398 |
type: bool |
| 399 |
|
| 400 |
all: |
| 401 |
description: all capability |
| 402 |
type: dict |
| 403 |
suboptions: |
| 404 |
inheritance_disable: |
| 405 |
description: Do not inherit this configuration from parent group. |
| 406 |
type: bool |
| 407 |
set: |
| 408 |
description: set all. |
| 409 |
type: bool |
| 410 |
cluster_id: *cluster_id |
| 411 |
description: |
| 412 |
description: Neighbor specific description. |
| 413 |
type: str |
| 414 |
dmz_link_bandwidth: &dmz_link_bw |
| 415 |
description: Propagate the DMZ link bandwidth. |
| 416 |
type: dict |
| 417 |
suboptions: |
| 418 |
inheritance_disable: |
| 419 |
description: Do not inherit this configuration from parent group. |
| 420 |
type: bool |
| 421 |
set: |
| 422 |
description: set dmz-link-bandwidth. |
| 423 |
type: bool |
| 424 |
dscp: |
| 425 |
description: Set IP DSCP (DiffServ CodePoint).Please refer vendor document for valid entries. |
| 426 |
type: str |
| 427 |
ebgp_multihop: |
| 428 |
description: Allow EBGP neighbors not on directly connected networks. |
| 429 |
type: dict |
| 430 |
suboptions: |
| 431 |
value: |
| 432 |
description: maximum hop count.Example-<1-255>. |
| 433 |
type: int |
| 434 |
mpls: |
| 435 |
description: Disable BGP MPLS forwarding. |
| 436 |
type: bool |
| 437 |
ebgp_recv_extcommunity_dmz: |
| 438 |
description: Receive extcommunity dmz link bandwidth from ebgp neighbor. |
| 439 |
type: dict |
| 440 |
suboptions: |
| 441 |
inheritance_disable: |
| 442 |
description: Prevent ebgp-recv-community-dmz from being inherited from parent |
| 443 |
type: bool |
| 444 |
set: |
| 445 |
description: set ebgp-recv-community-dmz. |
| 446 |
type: bool |
| 447 |
ebgp_send_extcommunity_dmz: |
| 448 |
description: Send extcommunity dmz link bandwidth from ebgp neighbor. |
| 449 |
type: dict |
| 450 |
suboptions: |
| 451 |
inheritance_disable: |
| 452 |
description: Prevent ebgp-send-community-dmz from being inherited from parent |
| 453 |
type: bool |
| 454 |
cumulatie: |
| 455 |
description: Send cumulative community dmz link bandwidth of all multipaths to ebgp neighbor. |
| 456 |
type: bool |
| 457 |
set: |
| 458 |
description: set ebgp-send-community-dmz. |
| 459 |
type: bool |
| 460 |
egress_engineering: |
| 461 |
type: dict |
| 462 |
description: Enable egress peer engineering for this neighbor. |
| 463 |
suboptions: |
| 464 |
inheritance_disable: |
| 465 |
description: Prevent egress-engineering from being inherited from parent |
| 466 |
type: bool |
| 467 |
set: |
| 468 |
description: set egress-engineering. |
| 469 |
type: bool |
| 470 |
enforce_first_as: *enforce_first_as |
| 471 |
graceful_maintenance: |
| 472 |
description: |
| 473 |
Attributes for Graceful Maintenance. This will cause neighbors to de-prefer routes from this router and |
| 474 |
choose alternates. This allows the router to be brought in or out of service gracefully. |
| 475 |
type: dict |
| 476 |
suboptions: |
| 477 |
set: |
| 478 |
description: set graceful maintenance. |
| 479 |
type: bool |
| 480 |
activate: |
| 481 |
description: Routes will be announced with the graceful maintenance attributes while activated either here or under router |
| 482 |
bgp configuration. |
| 483 |
type: dict |
| 484 |
suboptions: |
| 485 |
inheritance_disable: |
| 486 |
description: Prevent activate from being inherited from the parent. |
| 487 |
type: bool |
| 488 |
set: |
| 489 |
description: activate. |
| 490 |
type: bool |
| 491 |
as_prepends: |
| 492 |
description: Number of times to prepend the local AS number to the |
| 493 |
AS path of routes. Default=0 |
| 494 |
type: dict |
| 495 |
suboptions: |
| 496 |
inheritance_disable: |
| 497 |
description: Prevent as prepends from being inherited from the parent. |
| 498 |
type: bool |
| 499 |
value: |
| 500 |
description: Range of values for as prepends.Example-<0-6> . |
| 501 |
type: int |
| 502 |
local_preference: |
| 503 |
description: local preference with which to advertise routes to ibgp neigbors. Default=No Touch |
| 504 |
type: dict |
| 505 |
suboptions: |
| 506 |
value: |
| 507 |
description: Range of values for Local Preference.Example-<0-4294967295> . |
| 508 |
type: int |
| 509 |
inheritance_disable: |
| 510 |
description: Prevent local preference from being inherited from the parent. |
| 511 |
type: bool |
| 512 |
graceful_restart: |
| 513 |
description: Enable graceful restart support for this neighbor. |
| 514 |
type: dict |
| 515 |
suboptions: |
| 516 |
restart_time: *restart_time |
| 517 |
stalepath_time: *stalepath_time |
| 518 |
ignore_connected_check: |
| 519 |
description: Bypass the directly connected nexthop check for single-hop eBGP peering |
| 520 |
type: dict |
| 521 |
suboptions: |
| 522 |
inheritance_disable: |
| 523 |
description: Prevent ignore-connected-check from being inherited from the parent |
| 524 |
type: bool |
| 525 |
set: |
| 526 |
description: set ignore-connected-check. |
| 527 |
type: bool |
| 528 |
keychain: |
| 529 |
description: Set keychain based authentication. |
| 530 |
type: dict |
| 531 |
suboptions: |
| 532 |
name: |
| 533 |
description: Name of the key chain - maximum 32 characters. |
| 534 |
type: str |
| 535 |
inheritance_disable: |
| 536 |
description: Prevent keychain from being inherited from parent. |
| 537 |
type: bool |
| 538 |
local: |
| 539 |
type: dict |
| 540 |
description: Configure local parameter |
| 541 |
suboptions: |
| 542 |
address: |
| 543 |
description: IPv4 address |
| 544 |
type: dict |
| 545 |
suboptions: |
| 546 |
ipv4_address: |
| 547 |
description: IPv4 address <A.B.C.D>. |
| 548 |
type: str |
| 549 |
inheritance_disable: |
| 550 |
description: Prevent local address from being inherited from parent. |
| 551 |
type: bool |
| 552 |
local_as: |
| 553 |
description: Specify local AS number. |
| 554 |
type: dict |
| 555 |
suboptions: |
| 556 |
value: |
| 557 |
description: 2 byte, 4 byte As number |
| 558 |
type: int |
| 559 |
inheritance_disable: |
| 560 |
description: Prevent local AS from being inherited from parent. |
| 561 |
type: bool |
| 562 |
no_prepend: |
| 563 |
description: Do not prepend local AS to announcements from this neighbor. |
| 564 |
type: dict |
| 565 |
suboptions: |
| 566 |
set: |
| 567 |
type: bool |
| 568 |
description: Do not prepend local AS to announcements from this neighbor. |
| 569 |
replace_as: |
| 570 |
type: dict |
| 571 |
description: Prepend only local AS to announcements to this neighbor. |
| 572 |
suboptions: |
| 573 |
set: |
| 574 |
type: bool |
| 575 |
description: Prepend only local AS to announcements to this neighbor. |
| 576 |
dual_as: |
| 577 |
type: bool |
| 578 |
description: Dual-AS mode. |
| 579 |
log: |
| 580 |
description: Logging update messages per neighbor. |
| 581 |
type: dict |
| 582 |
suboptions: |
| 583 |
log_message: |
| 584 |
description: Logging update/notification messages per neighbor. |
| 585 |
type: dict |
| 586 |
suboptions: |
| 587 |
in: |
| 588 |
description: Inbound log messages |
| 589 |
type: dict |
| 590 |
suboptions: |
| 591 |
value: |
| 592 |
description: Range for message log buffer size <1-100>. |
| 593 |
type: int |
| 594 |
disable: |
| 595 |
description: Disable inbound message logging. |
| 596 |
type: bool |
| 597 |
inheritance_disable: |
| 598 |
description: Prevents the msg log from being inherited from the parent. |
| 599 |
type: bool |
| 600 |
out: |
| 601 |
description: Outbound log messages |
| 602 |
type: dict |
| 603 |
suboptions: |
| 604 |
value: |
| 605 |
description: Range for message log buffer size <1-100>. |
| 606 |
type: int |
| 607 |
disable: |
| 608 |
description: Disable inbound message logging. |
| 609 |
type: bool |
| 610 |
inheritance_disable: |
| 611 |
description: Prevents the msg log from being inherited from the parent. |
| 612 |
type: bool |
| 613 |
origin_as: |
| 614 |
description: BGP origin-AS knobs. |
| 615 |
type: dict |
| 616 |
suboptions: |
| 617 |
validation: |
| 618 |
description: BGP origin-AS validation knobs. |
| 619 |
type: dict |
| 620 |
suboptions: |
| 621 |
disable: |
| 622 |
description: Disable RPKI origin-AS validation. |
| 623 |
type: bool |
| 624 |
password: |
| 625 |
type: dict |
| 626 |
description: Set a password. |
| 627 |
suboptions: |
| 628 |
encrypted: |
| 629 |
type: str |
| 630 |
description: Specifies an ENCRYPTED password will follow. |
| 631 |
inheritance_disable: |
| 632 |
description: Prevent password from being inherited from parent. |
| 633 |
type: bool |
| 634 |
receive_buffer_size: |
| 635 |
description: Set socket and BGP receive buffer size.Example <512-131072>. |
| 636 |
type: int |
| 637 |
remote_as: |
| 638 |
description: Neighbor Autonomous System. |
| 639 |
type: str |
| 640 |
send_buffer_size: |
| 641 |
description: Set socket and BGP send buffer size.Example <4096-131072>. |
| 642 |
type: int |
| 643 |
session_open_mode: |
| 644 |
description: Establish BGP session using this TCP open mode. |
| 645 |
type: str |
| 646 |
choices: [ 'active-only', 'both', 'passive-only' ] |
| 647 |
shutdown: |
| 648 |
description: Administratively shut down this neighbor. |
| 649 |
type: dict |
| 650 |
suboptions: |
| 651 |
inheritance_disable: |
| 652 |
description: Prevent shutdown from being inherited from parent |
| 653 |
type: bool |
| 654 |
set: |
| 655 |
description: shutdown. |
| 656 |
type: bool |
| 657 |
tcp: |
| 658 |
description: TCP session configuration commands. |
| 659 |
type: dict |
| 660 |
suboptions: |
| 661 |
mss: |
| 662 |
description: Maximum Segment Size. |
| 663 |
type: dict |
| 664 |
suboptions: |
| 665 |
value: |
| 666 |
description: TCP initial maximum segment size. |
| 667 |
type: int |
| 668 |
inheritance_disable: |
| 669 |
description: Prevent mss from being inherited from parent |
| 670 |
type: bool |
| 671 |
timers: &timers |
| 672 |
description: BGP per neighbor timers. |
| 673 |
type: dict |
| 674 |
suboptions: |
| 675 |
keepalive_time: |
| 676 |
description: keepalive interval <0-65535>. |
| 677 |
type: int |
| 678 |
holdtime: |
| 679 |
description: hold time <3-65535> or 0 Disable hold time. |
| 680 |
type: int |
| 681 |
ttl_security: |
| 682 |
description: Enable EBGP TTL security. |
| 683 |
type: dict |
| 684 |
suboptions: |
| 685 |
inheritance_disable: |
| 686 |
description: Prevent ttl-security from being inherited from parent |
| 687 |
type: bool |
| 688 |
set: |
| 689 |
description: set ttl-security |
| 690 |
type: bool |
| 691 |
update: |
| 692 |
description: BGP Update configuration. |
| 693 |
type: dict |
| 694 |
suboptions: |
| 695 |
in: |
| 696 |
description: Inbound update message handling. |
| 697 |
type: dict |
| 698 |
suboptions: |
| 699 |
filtering: |
| 700 |
description: Inbound update message filtering |
| 701 |
type: dict |
| 702 |
suboptions: |
| 703 |
attribute_filter: |
| 704 |
description: Attribute-filter configuration. |
| 705 |
type: dict |
| 706 |
suboptions: |
| 707 |
group: |
| 708 |
description: Name of group. |
| 709 |
type: str |
| 710 |
logging: |
| 711 |
description: Update filtering syslog message. |
| 712 |
type: dict |
| 713 |
suboptions: |
| 714 |
disable: |
| 715 |
description: Disable update filtering syslog message. |
| 716 |
type: bool |
| 717 |
update_message: |
| 718 |
description: Filtered update messages. |
| 719 |
type: dict |
| 720 |
suboptions: |
| 721 |
buffers: |
| 722 |
description: Number of buffers to store filtered update messages. |
| 723 |
type: int |
| 724 |
update_source: |
| 725 |
description: Source of routing updates.Refer vendor document for valid values. |
| 726 |
type: str |
| 727 |
use: |
| 728 |
description: Use a neighbor-group and session-group template. |
| 729 |
type: dict |
| 730 |
suboptions: |
| 731 |
neighbor_group: |
| 732 |
description: Inherit configuration from a neighbor-group. |
| 733 |
type: str |
| 734 |
session_group: |
| 735 |
description: Inherit address-family independent config from a session-group |
| 736 |
type: str |
| 737 |
nsr: |
| 738 |
description: Enable non-stop-routing support for all neighbors. |
| 739 |
type: dict |
| 740 |
suboptions: |
| 741 |
set: |
| 742 |
type: bool |
| 743 |
description: set nsr |
| 744 |
disable: |
| 745 |
type: bool |
| 746 |
description: disable nsr |
| 747 |
socket: &socket |
| 748 |
description: set socket parameters. |
| 749 |
type: dict |
| 750 |
suboptions: |
| 751 |
receive_buffer_size: |
| 752 |
description: socket receive buffer size.Example-<512-131072>. |
| 753 |
type: int |
| 754 |
send_buffer_size: |
| 755 |
description: socket send buffer size.Example- <4096-131072>. |
| 756 |
type: int |
| 757 |
timers: *timers |
| 758 |
update: |
| 759 |
description: BGP Update configuration. |
| 760 |
type: dict |
| 761 |
suboptions: |
| 762 |
in: |
| 763 |
description: Inbound update message handling |
| 764 |
type: dict |
| 765 |
suboptions: |
| 766 |
error_handling: |
| 767 |
description: Inbound update message error handling. |
| 768 |
type: dict |
| 769 |
suboptions: |
| 770 |
basic: |
| 771 |
description: Inbound update message basic error handling |
| 772 |
type: dict |
| 773 |
suboptions: |
| 774 |
ebgp: |
| 775 |
type: dict |
| 776 |
description: Inbound update message basic error handling for EBGP neighbors |
| 777 |
suboptions: |
| 778 |
disable: |
| 779 |
description: disable |
| 780 |
type: bool |
| 781 |
ibgp: |
| 782 |
type: dict |
| 783 |
description: Inbound update message basic error handling for ibgp neighbors |
| 784 |
suboptions: |
| 785 |
disable: |
| 786 |
description: disable |
| 787 |
type: bool |
| 788 |
extended: |
| 789 |
description: Inbound update message extended error handling |
| 790 |
type: dict |
| 791 |
suboptions: |
| 792 |
ebgp: |
| 793 |
type: bool |
| 794 |
description: Inbound update message extended error handling for EBGP neighbors |
| 795 |
|
| 796 |
ibgp: |
| 797 |
type: bool |
| 798 |
description: Inbound update message extended error handling for ibgp neighbors |
| 799 |
out: |
| 800 |
description: BGP Update generation configuration. |
| 801 |
type: dict |
| 802 |
suboptions: |
| 803 |
logging: |
| 804 |
description: Enable logging of update generation events. |
| 805 |
type: bool |
| 806 |
limit: |
| 807 |
description: Upper bound on transient memory usage for update generation.Example-<16-2048>. |
| 808 |
type: int |
| 809 |
rpki: |
| 810 |
description: Configure RPKI. |
| 811 |
type: dict |
| 812 |
suboptions: |
| 813 |
route: |
| 814 |
description: Configure an RPKI route.A.B.C.D/length or X:X::X/length Network/Minimum prefix length |
| 815 |
type: dict |
| 816 |
suboptions: |
| 817 |
value: |
| 818 |
description: A.B.C.D/length or X:X::X/length Network/Minimum prefix length. |
| 819 |
type: str |
| 820 |
max: |
| 821 |
description: Maximum prefix length. Example- <1-128> . |
| 822 |
type: int |
| 823 |
origin: |
| 824 |
description: Origin Autonomous System number (in asplain format) Example-<1-4294967295>. |
| 825 |
type: int |
| 826 |
servers: |
| 827 |
description: Configure RPKI cache-servers. |
| 828 |
type: list |
| 829 |
elements: dict |
| 830 |
suboptions: |
| 831 |
name: |
| 832 |
description: address of rpki server. |
| 833 |
type: str |
| 834 |
purge_time: |
| 835 |
type: int |
| 836 |
description: Time to wait after a cache goes down to clean up stale routes |
| 837 |
refresh_time: |
| 838 |
type: dict |
| 839 |
description: Time between sending serial-queries for the RPKI cache-server |
| 840 |
suboptions: |
| 841 |
value: |
| 842 |
description: Purge time (in seconds) <30-360> |
| 843 |
type: int |
| 844 |
time_off: |
| 845 |
description: Do not send serial-queries periodically |
| 846 |
type: bool |
| 847 |
response_time: |
| 848 |
type: dict |
| 849 |
description: Time to wait for a response from the RPKI cache-server |
| 850 |
suboptions: |
| 851 |
value: |
| 852 |
description: Purge time (in seconds) <15-3600> |
| 853 |
type: int |
| 854 |
time_off: |
| 855 |
description: Wait indefinitely for a response |
| 856 |
type: bool |
| 857 |
shutdown: |
| 858 |
type: bool |
| 859 |
description: Shutdown the RPKI cache-server |
| 860 |
transport: |
| 861 |
type: dict |
| 862 |
description: Specify a transport method for the RPKI cache-server |
| 863 |
suboptions: |
| 864 |
ssh: |
| 865 |
description: Connect to the RPKI cache-server using SSH |
| 866 |
type: dict |
| 867 |
suboptions: |
| 868 |
port: |
| 869 |
description: Specify a port number for the RPKI cache-server transport |
| 870 |
type: int |
| 871 |
tcp: |
| 872 |
description: Connect to the RPKI cache-server using TCP (unencrypted) |
| 873 |
type: dict |
| 874 |
suboptions: |
| 875 |
port: |
| 876 |
description: Specify a port number for the RPKI cache-server transport |
| 877 |
type: int |
| 878 |
vrfs: |
| 879 |
description: Specify a vrf name. |
| 880 |
type: list |
| 881 |
elements: dict |
| 882 |
suboptions: |
| 883 |
vrf: |
| 884 |
description: VRF name. |
| 885 |
type: str |
| 886 |
bfd: *bfd |
| 887 |
bgp: |
| 888 |
description: BGP commands. |
| 889 |
type: dict |
| 890 |
suboptions: |
| 891 |
auto_policy_soft_reset: *auto_policy_soft_reset |
| 892 |
bestpath: *bestpath |
| 893 |
default: *default |
| 894 |
enforce_first_as: *enforce_first_as |
| 895 |
fast_external_fallover: *fast_external_fallover |
| 896 |
log: *bgp_log |
| 897 |
multipath: *multipath |
| 898 |
redistribute_internal: *redistribute_internal |
| 899 |
router_id: *router_id |
| 900 |
unsafe_ebgp_policy: *ebgp_policy |
| 901 |
default_information: *default_info |
| 902 |
default_metric: *default_metric |
| 903 |
mpls: *mpls |
| 904 |
neighbors: *neighbors |
| 905 |
rd: |
| 906 |
description: route distinguisher. |
| 907 |
type: dict |
| 908 |
suboptions: |
| 909 |
auto: |
| 910 |
description: Automatic route distinguisher. |
| 911 |
type: bool |
| 912 |
socket: *socket |
| 913 |
timers: *timers |
| 914 |
running_config: |
| 915 |
description: |
| 916 |
The state the configuration should be left in. |
| 917 |
- State I(purged) removes all the BGP configurations from the |
| 918 |
target device. Use caution with this state. |
| 919 |
- State I(deleted) only removes BGP attributes that this modules |
| 920 |
manages and does not negate the BGP process completely. Thereby, preserving |
| 921 |
address-family related configurations under BGP context. |
| 922 |
- Running states I(deleted) and I(replaced) will result in an error if there |
| 923 |
are address-family configuration lines present under a neighbor, |
| 924 |
or a vrf context that is to be removed. Please use the |
| 925 |
M(cisco.iosxr.iosxr_bgp_address_family) or M(cisco.iosxr.iosxr_bgp_neighbor_address_family) |
| 926 |
modules for prior cleanup. |
| 927 |
- Refer to examples for more details. |
| 928 |
type: str |
| 929 |
state: |
| 930 |
description: |
| 931 |
- The state the configuration should be left in. |
| 932 |
type: str |
| 933 |
choices: [deleted, merged, replaced, gathered, rendered, parsed, purged, overridden] |
| 934 |
default: merged |
| 935 |
""" |
| 936 |
EXAMPLES = """ |
| 937 |
|
| 938 |
# Using merged |
| 939 |
# |
| 940 |
# Before state |
| 941 |
# ------------ |
| 942 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 943 |
# Thu Feb 4 09:38:36.245 UTC |
| 944 |
# % No such configuration item(s) |
| 945 |
# RP/0/0/CPU0:10# |
| 946 |
|
| 947 |
- name: Merge the following BGP global configuration |
| 948 |
cisco.iosxr.iosxr_bgp_global: |
| 949 |
config: |
| 950 |
as_number: 65536 |
| 951 |
default_metric: 5 |
| 952 |
socket: |
| 953 |
receive_buffer_size: 514 |
| 954 |
send_buffer_size: 4098 |
| 955 |
bgp: |
| 956 |
confederation: |
| 957 |
identifier: 4 |
| 958 |
bestpath: |
| 959 |
med: |
| 960 |
confed: true |
| 961 |
cluster_id: 5 |
| 962 |
router_id: 192.0.2.10 |
| 963 |
neighbors: |
| 964 |
- neighbor: 192.0.2.13 |
| 965 |
remote_as: 65538 |
| 966 |
bfd: |
| 967 |
fast_detect: |
| 968 |
strict_mode: true |
| 969 |
multiplier: 6 |
| 970 |
minimum_interval: 20 |
| 971 |
vrfs: |
| 972 |
- vrf: vrf1 |
| 973 |
default_metric: 5 |
| 974 |
|
| 975 |
# |
| 976 |
# Task Output: |
| 977 |
# --------------- |
| 978 |
# |
| 979 |
# before: {} |
| 980 |
# commands: |
| 981 |
# - router bgp 65536 |
| 982 |
# - bgp cluster-id 5 |
| 983 |
# - bgp router-id 192.0.2.10 |
| 984 |
# - bgp bestpath med confed |
| 985 |
# - bgp confederation identifier 4 |
| 986 |
# - default-metric 5 |
| 987 |
# - socket receive-buffer-size 514 |
| 988 |
# - socket send-buffer-size 4098 |
| 989 |
# - neighbor 192.0.2.13 |
| 990 |
# - bfd fast-detect strict-mode |
| 991 |
# - bfd minimum-interval 20 |
| 992 |
# - bfd multiplier 6 |
| 993 |
# - remote-as 65538 |
| 994 |
# - vrf vrf1 |
| 995 |
# - default-metric 5 |
| 996 |
# |
| 997 |
# after: |
| 998 |
# as_number: '65536' |
| 999 |
# bgp: |
| 1000 |
# bestpath: |
| 1001 |
# med: |
| 1002 |
# confed: true |
| 1003 |
# cluster_id: '5' |
| 1004 |
# confederation: |
| 1005 |
# identifier: 4 |
| 1006 |
# router_id: 192.0.2.10 |
| 1007 |
# default_metric: 5 |
| 1008 |
# neighbors: |
| 1009 |
# - bfd: |
| 1010 |
# fast_detect: |
| 1011 |
# strict_mode: true |
| 1012 |
# minimum_interval: 20 |
| 1013 |
# multiplier: 6 |
| 1014 |
# neighbor_address: 192.0.2.13 |
| 1015 |
# remote_as: 65538 |
| 1016 |
# socket: |
| 1017 |
# receive_buffer_size: 514 |
| 1018 |
# send_buffer_size: 4098 |
| 1019 |
# vrfs: |
| 1020 |
# - default_metric: 5 |
| 1021 |
# vrf: vrf1 |
| 1022 |
# |
| 1023 |
# After state |
| 1024 |
# ----------- |
| 1025 |
|
| 1026 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1027 |
# Thu Feb 4 09:44:32.480 UTC |
| 1028 |
# router bgp 65536 |
| 1029 |
# bgp confederation identifier 4 |
| 1030 |
# bgp router-id 192.0.2.10 |
| 1031 |
# bgp cluster-id 5 |
| 1032 |
# default-metric 5 |
| 1033 |
# socket send-buffer-size 4098 |
| 1034 |
# bgp bestpath med confed |
| 1035 |
# socket receive-buffer-size 514 |
| 1036 |
# neighbor 192.0.2.13 |
| 1037 |
# remote-as 65538 |
| 1038 |
# bfd fast-detect strict-mode |
| 1039 |
# bfd multiplier 6 |
| 1040 |
# bfd minimum-interval 20 |
| 1041 |
# ! |
| 1042 |
# vrf vrf1 |
| 1043 |
# default-metric 5 |
| 1044 |
# ! |
| 1045 |
# ! |
| 1046 |
|
| 1047 |
# Using replaced |
| 1048 |
# |
| 1049 |
# Before state |
| 1050 |
# ------------ |
| 1051 |
# |
| 1052 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1053 |
# Thu Feb 4 09:44:32.480 UTC |
| 1054 |
# router bgp 65536 |
| 1055 |
# bgp confederation identifier 4 |
| 1056 |
# bgp router-id 192.0.2.10 |
| 1057 |
# bgp cluster-id 5 |
| 1058 |
# default-metric 5 |
| 1059 |
# socket send-buffer-size 4098 |
| 1060 |
# bgp bestpath med confed |
| 1061 |
# socket receive-buffer-size 514 |
| 1062 |
# neighbor 192.0.2.13 |
| 1063 |
# remote-as 65538 |
| 1064 |
# bfd fast-detect strict-mode |
| 1065 |
# bfd multiplier 6 |
| 1066 |
# bfd minimum-interval 20 |
| 1067 |
# ! |
| 1068 |
# vrf vrf1 |
| 1069 |
# default-metric 5 |
| 1070 |
# ! |
| 1071 |
# ! |
| 1072 |
|
| 1073 |
- name: Replace the following configuration |
| 1074 |
cisco.iosxr.iosxr_bgp_global: |
| 1075 |
state: replaced |
| 1076 |
config: |
| 1077 |
as_number: 65536 |
| 1078 |
default_metric: 4 |
| 1079 |
socket: |
| 1080 |
receive_buffer_size: 514 |
| 1081 |
send_buffer_size: 4098 |
| 1082 |
bgp: |
| 1083 |
confederation: |
| 1084 |
identifier: 4 |
| 1085 |
bestpath: |
| 1086 |
med: |
| 1087 |
confed: true |
| 1088 |
cluster_id: 5 |
| 1089 |
router_id: 192.0.2.10 |
| 1090 |
neighbors: |
| 1091 |
- neighbor: 192.0.2.14 |
| 1092 |
remote_as: 65538 |
| 1093 |
bfd: |
| 1094 |
fast_detect: |
| 1095 |
strict_mode: true |
| 1096 |
multiplier: 6 |
| 1097 |
minimum_interval: 20 |
| 1098 |
vrfs: |
| 1099 |
- vrf: vrf1 |
| 1100 |
default_metric: 5 |
| 1101 |
|
| 1102 |
# |
| 1103 |
# Task Output: |
| 1104 |
# ------------- |
| 1105 |
# |
| 1106 |
# before: |
| 1107 |
# as_number: '65536' |
| 1108 |
# bgp: |
| 1109 |
# bestpath: |
| 1110 |
# med: |
| 1111 |
# confed: true |
| 1112 |
# cluster_id: '5' |
| 1113 |
# confederation: |
| 1114 |
# identifier: 4 |
| 1115 |
# router_id: 192.0.2.10 |
| 1116 |
# default_metric: 5 |
| 1117 |
# neighbors: |
| 1118 |
# - bfd: |
| 1119 |
# fast_detect: |
| 1120 |
# strict_mode: true |
| 1121 |
# minimum_interval: 20 |
| 1122 |
# multiplier: 6 |
| 1123 |
# neighbor_address: 192.0.2.13 |
| 1124 |
# remote_as: 65538 |
| 1125 |
# socket: |
| 1126 |
# receive_buffer_size: 514 |
| 1127 |
# send_buffer_size: 4098 |
| 1128 |
# vrfs: |
| 1129 |
# - default_metric: 5 |
| 1130 |
# vrf: vrf1 |
| 1131 |
# |
| 1132 |
# commands: |
| 1133 |
# - router bgp 65536 |
| 1134 |
# - default-metric 4 |
| 1135 |
# - neighbor 192.0.2.14 |
| 1136 |
# - bfd fast-detect strict-mode |
| 1137 |
# - bfd minimum-interval 20 |
| 1138 |
# - bfd multiplier 6 |
| 1139 |
# - remote-as 65538 |
| 1140 |
# - no neighbor 192.0.2.13 |
| 1141 |
# |
| 1142 |
# after: |
| 1143 |
# as_number: '65536' |
| 1144 |
# bgp: |
| 1145 |
# bestpath: |
| 1146 |
# med: |
| 1147 |
# confed: true |
| 1148 |
# cluster_id: '5' |
| 1149 |
# confederation: |
| 1150 |
# identifier: 4 |
| 1151 |
# router_id: 192.0.2.10 |
| 1152 |
# default_metric: 4 |
| 1153 |
# neighbors: |
| 1154 |
# - bfd: |
| 1155 |
# fast_detect: |
| 1156 |
# strict_mode: true |
| 1157 |
# minimum_interval: 20 |
| 1158 |
# multiplier: 6 |
| 1159 |
# neighbor_address: 192.0.2.14 |
| 1160 |
# remote_as: 65538 |
| 1161 |
# socket: |
| 1162 |
# receive_buffer_size: 514 |
| 1163 |
# send_buffer_size: 4098 |
| 1164 |
# vrfs: |
| 1165 |
# - default_metric: 5 |
| 1166 |
# vrf: vrf1 |
| 1167 |
# |
| 1168 |
# After state |
| 1169 |
# ----------- |
| 1170 |
# |
| 1171 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1172 |
# Thu Feb 4 09:54:11.161 UTC |
| 1173 |
# router bgp 65536 |
| 1174 |
# bgp confederation identifier 4 |
| 1175 |
# bgp router-id 192.0.2.10 |
| 1176 |
# bgp cluster-id 5 |
| 1177 |
# default-metric 4 |
| 1178 |
# socket send-buffer-size 4098 |
| 1179 |
# bgp bestpath med confed |
| 1180 |
# socket receive-buffer-size 514 |
| 1181 |
# neighbor 192.0.2.14 |
| 1182 |
# remote-as 65538 |
| 1183 |
# bfd fast-detect strict-mode |
| 1184 |
# bfd multiplier 6 |
| 1185 |
# bfd minimum-interval 20 |
| 1186 |
# ! |
| 1187 |
# vrf vrf1 |
| 1188 |
# default-metric 5 |
| 1189 |
# ! |
| 1190 |
# ! |
| 1191 |
|
| 1192 |
# Using overridden |
| 1193 |
# |
| 1194 |
# Before state |
| 1195 |
# ------------ |
| 1196 |
# |
| 1197 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1198 |
# Thu Feb 4 09:44:32.480 UTC |
| 1199 |
# router bgp 65536 |
| 1200 |
# bgp confederation identifier 4 |
| 1201 |
# bgp router-id 192.0.2.10 |
| 1202 |
# bgp cluster-id 5 |
| 1203 |
# default-metric 5 |
| 1204 |
# socket send-buffer-size 4098 |
| 1205 |
# bgp bestpath med confed |
| 1206 |
# socket receive-buffer-size 514 |
| 1207 |
# neighbor 192.0.2.13 |
| 1208 |
# remote-as 65538 |
| 1209 |
# bfd fast-detect strict-mode |
| 1210 |
# bfd multiplier 6 |
| 1211 |
# bfd minimum-interval 20 |
| 1212 |
# ! |
| 1213 |
# vrf vrf1 |
| 1214 |
# default-metric 5 |
| 1215 |
# ! |
| 1216 |
# ! |
| 1217 |
|
| 1218 |
- name: Override running config with provided configuration |
| 1219 |
cisco.iosxr.iosxr_bgp_global: |
| 1220 |
state: overridden |
| 1221 |
config: |
| 1222 |
as_number: 65536 |
| 1223 |
default_metric: 4 |
| 1224 |
socket: |
| 1225 |
receive_buffer_size: 514 |
| 1226 |
send_buffer_size: 4098 |
| 1227 |
bgp: |
| 1228 |
confederation: |
| 1229 |
identifier: 4 |
| 1230 |
bestpath: |
| 1231 |
med: |
| 1232 |
confed: true |
| 1233 |
cluster_id: 5 |
| 1234 |
router_id: 192.0.2.10 |
| 1235 |
neighbors: |
| 1236 |
- neighbor: 192.0.2.14 |
| 1237 |
remote_as: 65538 |
| 1238 |
bfd: |
| 1239 |
fast_detect: |
| 1240 |
strict_mode: true |
| 1241 |
multiplier: 6 |
| 1242 |
minimum_interval: 20 |
| 1243 |
vrfs: |
| 1244 |
- vrf: vrf1 |
| 1245 |
default_metric: 5 |
| 1246 |
# |
| 1247 |
# Task Output: |
| 1248 |
# ------------- |
| 1249 |
# |
| 1250 |
# before: |
| 1251 |
# as_number: '65536' |
| 1252 |
# bgp: |
| 1253 |
# bestpath: |
| 1254 |
# med: |
| 1255 |
# confed: true |
| 1256 |
# cluster_id: '5' |
| 1257 |
# confederation: |
| 1258 |
# identifier: 4 |
| 1259 |
# router_id: 192.0.2.10 |
| 1260 |
# default_metric: 5 |
| 1261 |
# neighbors: |
| 1262 |
# - bfd: |
| 1263 |
# fast_detect: |
| 1264 |
# strict_mode: true |
| 1265 |
# minimum_interval: 20 |
| 1266 |
# multiplier: 6 |
| 1267 |
# neighbor_address: 192.0.2.13 |
| 1268 |
# remote_as: 65538 |
| 1269 |
# socket: |
| 1270 |
# receive_buffer_size: 514 |
| 1271 |
# send_buffer_size: 4098 |
| 1272 |
# vrfs: |
| 1273 |
# - default_metric: 5 |
| 1274 |
# vrf: vrf1 |
| 1275 |
# |
| 1276 |
# commands: |
| 1277 |
# - router bgp 65536 |
| 1278 |
# - default-metric 4 |
| 1279 |
# - neighbor 192.0.2.14 |
| 1280 |
# - bfd fast-detect strict-mode |
| 1281 |
# - bfd minimum-interval 20 |
| 1282 |
# - bfd multiplier 6 |
| 1283 |
# - remote-as 65538 |
| 1284 |
# - no neighbor 192.0.2.13 |
| 1285 |
# |
| 1286 |
# after: |
| 1287 |
# as_number: '65536' |
| 1288 |
# bgp: |
| 1289 |
# bestpath: |
| 1290 |
# med: |
| 1291 |
# confed: true |
| 1292 |
# cluster_id: '5' |
| 1293 |
# confederation: |
| 1294 |
# identifier: 4 |
| 1295 |
# router_id: 192.0.2.10 |
| 1296 |
# default_metric: 4 |
| 1297 |
# neighbors: |
| 1298 |
# - bfd: |
| 1299 |
# fast_detect: |
| 1300 |
# strict_mode: true |
| 1301 |
# minimum_interval: 20 |
| 1302 |
# multiplier: 6 |
| 1303 |
# neighbor_address: 192.0.2.14 |
| 1304 |
# remote_as: 65538 |
| 1305 |
# socket: |
| 1306 |
# receive_buffer_size: 514 |
| 1307 |
# send_buffer_size: 4098 |
| 1308 |
# vrfs: |
| 1309 |
# - default_metric: 5 |
| 1310 |
# vrf: vrf1 |
| 1311 |
|
| 1312 |
# After state |
| 1313 |
# ----------- |
| 1314 |
# |
| 1315 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1316 |
# Thu Feb 4 09:54:11.161 UTC |
| 1317 |
# router bgp 65536 |
| 1318 |
# bgp confederation identifier 4 |
| 1319 |
# bgp router-id 192.0.2.10 |
| 1320 |
# bgp cluster-id 5 |
| 1321 |
# default-metric 4 |
| 1322 |
# socket send-buffer-size 4098 |
| 1323 |
# bgp bestpath med confed |
| 1324 |
# socket receive-buffer-size 514 |
| 1325 |
# neighbor 192.0.2.14 |
| 1326 |
# remote-as 65538 |
| 1327 |
# bfd fast-detect strict-mode |
| 1328 |
# bfd multiplier 6 |
| 1329 |
# bfd minimum-interval 20 |
| 1330 |
# ! |
| 1331 |
# vrf vrf1 |
| 1332 |
# default-metric 5 |
| 1333 |
# ! |
| 1334 |
# ! |
| 1335 |
|
| 1336 |
# Using deleted |
| 1337 |
# |
| 1338 |
# Before state |
| 1339 |
# ------------ |
| 1340 |
# |
| 1341 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1342 |
# Thu Feb 4 09:54:11.161 UTC |
| 1343 |
# router bgp 65536 |
| 1344 |
# bgp confederation identifier 4 |
| 1345 |
# bgp router-id 192.0.2.10 |
| 1346 |
# bgp cluster-id 5 |
| 1347 |
# default-metric 4 |
| 1348 |
# socket send-buffer-size 4098 |
| 1349 |
# bgp bestpath med confed |
| 1350 |
# socket receive-buffer-size 514 |
| 1351 |
# neighbor 192.0.2.14 |
| 1352 |
# remote-as 65538 |
| 1353 |
# bfd fast-detect strict-mode |
| 1354 |
# bfd multiplier 6 |
| 1355 |
# bfd minimum-interval 20 |
| 1356 |
# ! |
| 1357 |
# vrf vrf1 |
| 1358 |
# default-metric 5 |
| 1359 |
# ! |
| 1360 |
# ! |
| 1361 |
# |
| 1362 |
|
| 1363 |
- name: Delete BGP configurations handled by this module |
| 1364 |
cisco.iosxr.iosxr_bgp_global: |
| 1365 |
config: |
| 1366 |
as_number: 65536 |
| 1367 |
state: deleted |
| 1368 |
|
| 1369 |
# |
| 1370 |
# Task Output: |
| 1371 |
# ------------- |
| 1372 |
# |
| 1373 |
# before: |
| 1374 |
# as_number: '65536' |
| 1375 |
# bgp: |
| 1376 |
# bestpath: |
| 1377 |
# med: |
| 1378 |
# confed: true |
| 1379 |
# cluster_id: '5' |
| 1380 |
# confederation: |
| 1381 |
# identifier: 4 |
| 1382 |
# router_id: 192.0.2.10 |
| 1383 |
# default_metric: 4 |
| 1384 |
# neighbors: |
| 1385 |
# - bfd: |
| 1386 |
# fast_detect: |
| 1387 |
# strict_mode: true |
| 1388 |
# minimum_interval: 20 |
| 1389 |
# multiplier: 6 |
| 1390 |
# neighbor_address: 192.0.2.14 |
| 1391 |
# remote_as: 65538 |
| 1392 |
# socket: |
| 1393 |
# receive_buffer_size: 514 |
| 1394 |
# send_buffer_size: 4098 |
| 1395 |
# vrfs: |
| 1396 |
# - default_metric: 5 |
| 1397 |
# vrf: vrf1 |
| 1398 |
# |
| 1399 |
# commands: |
| 1400 |
# - router bgp 65536 |
| 1401 |
# - no bgp cluster-id 5 |
| 1402 |
# - no bgp router-id 192.0.2.10 |
| 1403 |
# - no bgp bestpath med confed |
| 1404 |
# - no bgp confederation identifier 4 |
| 1405 |
# - no default-metric 4 |
| 1406 |
# - no socket receive-buffer-size 514 |
| 1407 |
# - no socket send-buffer-size 4098 |
| 1408 |
# - no neighbor 192.0.2.14 |
| 1409 |
# - no vrf vrf1 |
| 1410 |
# |
| 1411 |
# after: |
| 1412 |
# as_number: '65536' |
| 1413 |
# |
| 1414 |
# After state |
| 1415 |
# ----------- |
| 1416 |
# |
| 1417 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1418 |
# Thu Feb 4 10:01:08.232 UTC |
| 1419 |
# router bgp 65536 |
| 1420 |
# ! |
| 1421 |
# |
| 1422 |
|
| 1423 |
# Using purged |
| 1424 |
# |
| 1425 |
# Before state |
| 1426 |
# ------------ |
| 1427 |
# |
| 1428 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1429 |
# Thu Feb 4 09:54:11.161 UTC |
| 1430 |
# router bgp 65536 |
| 1431 |
# bgp confederation identifier 4 |
| 1432 |
# bgp router-id 192.0.2.10 |
| 1433 |
# bgp cluster-id 5 |
| 1434 |
# default-metric 5 |
| 1435 |
# socket send-buffer-size 4098 |
| 1436 |
# bgp bestpath med confed |
| 1437 |
# socket receive-buffer-size 514 |
| 1438 |
# neighbor 192.0.2.13 |
| 1439 |
# remote-as 65538 |
| 1440 |
# bfd fast-detect strict-mode |
| 1441 |
# bfd multiplier 6 |
| 1442 |
# bfd minimum-interval 20 |
| 1443 |
# ! |
| 1444 |
# vrf vrf1 |
| 1445 |
# default-metric 5 |
| 1446 |
# ! |
| 1447 |
# ! |
| 1448 |
# |
| 1449 |
|
| 1450 |
- name: Purge all BGP configurations from the device |
| 1451 |
cisco.iosxr.iosxr_bgp_global: |
| 1452 |
state: purged |
| 1453 |
|
| 1454 |
# |
| 1455 |
# Task Output: |
| 1456 |
# ------------- |
| 1457 |
# |
| 1458 |
# before: |
| 1459 |
# as_number: '65536' |
| 1460 |
# bgp: |
| 1461 |
# bestpath: |
| 1462 |
# med: |
| 1463 |
# confed: true |
| 1464 |
# cluster_id: '5' |
| 1465 |
# confederation: |
| 1466 |
# identifier: 4 |
| 1467 |
# router_id: 192.0.2.10 |
| 1468 |
# default_metric: 5 |
| 1469 |
# neighbors: |
| 1470 |
# - bfd: |
| 1471 |
# fast_detect: |
| 1472 |
# strict_mode: true |
| 1473 |
# minimum_interval: 20 |
| 1474 |
# multiplier: 6 |
| 1475 |
# neighbor_address: 192.0.2.13 |
| 1476 |
# remote_as: 65538 |
| 1477 |
# socket: |
| 1478 |
# receive_buffer_size: 514 |
| 1479 |
# send_buffer_size: 4098 |
| 1480 |
# vrfs: |
| 1481 |
# - default_metric: 5 |
| 1482 |
# vrf: vrf1 |
| 1483 |
# |
| 1484 |
# commands: |
| 1485 |
# - no router bgp 65536 |
| 1486 |
# |
| 1487 |
# after: {} |
| 1488 |
# |
| 1489 |
# After state |
| 1490 |
# ----------- |
| 1491 |
# |
| 1492 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1493 |
# Thu Feb 4 09:38:36.245 UTC |
| 1494 |
# % No such configuration item(s) |
| 1495 |
# RP/0/0/CPU0:10# |
| 1496 |
# |
| 1497 |
|
| 1498 |
# |
| 1499 |
# Using Rendered |
| 1500 |
# ----------------- |
| 1501 |
# |
| 1502 |
- name: >- |
| 1503 |
Render platform specific configuration lines (without connecting to the |
| 1504 |
device) |
| 1505 |
cisco.iosxr.iosxr_bgp_global: |
| 1506 |
state: rendered |
| 1507 |
config: |
| 1508 |
as_number: 1 |
| 1509 |
default_metric: 4 |
| 1510 |
vrfs: |
| 1511 |
- vrf: vrf3 |
| 1512 |
bfd: |
| 1513 |
minimum_interval: 20 |
| 1514 |
multiplier: 10 |
| 1515 |
bgp: |
| 1516 |
fast_external_fallover: |
| 1517 |
disable: true |
| 1518 |
router_id: 1.2.3.4 |
| 1519 |
auto_policy_soft_reset: |
| 1520 |
disable: true |
| 1521 |
timers: |
| 1522 |
keepalive_time: 20 |
| 1523 |
holdtime: 30 |
| 1524 |
- vrf: vrf2 |
| 1525 |
bgp: |
| 1526 |
enforce_first_as: |
| 1527 |
disable: true |
| 1528 |
default_metric: 4 |
| 1529 |
neighbors: |
| 1530 |
- neighbor: 1.1.1.3 |
| 1531 |
remote_as: 2 |
| 1532 |
graceful_maintenance: |
| 1533 |
set: true |
| 1534 |
activate: |
| 1535 |
inheritance_disable: true |
| 1536 |
local_preference: |
| 1537 |
value: 1 |
| 1538 |
as_prepends: |
| 1539 |
value: 2 |
| 1540 |
|
| 1541 |
# |
| 1542 |
# Task output |
| 1543 |
# ----------------------- |
| 1544 |
# rendered: |
| 1545 |
# - router bgp 1 |
| 1546 |
# - default-metric 4 |
| 1547 |
# - vrf vrf3 |
| 1548 |
# - bfd multiplier 10 |
| 1549 |
# - bfd minimum-interval 20 |
| 1550 |
# - bgp auto-policy-soft-reset disable |
| 1551 |
# - bgp fast-external-fallover disable |
| 1552 |
# - bgp router-id 1.2.3.4 |
| 1553 |
# - timers bgp 20 30 |
| 1554 |
# - vrf vrf2 |
| 1555 |
# - neighbor 1.1.1.3 |
| 1556 |
# - remote-as 2 |
| 1557 |
# - graceful-maintenance |
| 1558 |
# - graceful-maintenance activate inheritance-disable |
| 1559 |
# - graceful-maintenance local-preference 1 |
| 1560 |
# - graceful-maintenance as-prepends 2 |
| 1561 |
# - bgp enforce-first-as disable |
| 1562 |
# - default-metric 4 |
| 1563 |
|
| 1564 |
# Using parsed |
| 1565 |
# |
| 1566 |
# parsed.cfg |
| 1567 |
# ------------ |
| 1568 |
# router bgp 65536 |
| 1569 |
# bgp confederation identifier 4 |
| 1570 |
# bgp router-id 192.0.2.10 |
| 1571 |
# bgp cluster-id 5 |
| 1572 |
# default-metric 4 |
| 1573 |
# socket send-buffer-size 4098 |
| 1574 |
# bgp bestpath med confed |
| 1575 |
# socket receive-buffer-size 514 |
| 1576 |
# neighbor 192.0.2.11 |
| 1577 |
# remote-as 65537 |
| 1578 |
# cluster-id 3 |
| 1579 |
# ! |
| 1580 |
# neighbor 192.0.2.14 |
| 1581 |
# remote-as 65538 |
| 1582 |
# bfd fast-detect strict-mode |
| 1583 |
# bfd multiplier 6 |
| 1584 |
# bfd minimum-interval 20 |
| 1585 |
# ! |
| 1586 |
# ! |
| 1587 |
# |
| 1588 |
|
| 1589 |
- name: Parse externally provided BGP config |
| 1590 |
cisco.iosxr.iosxr_bgp_global: |
| 1591 |
running_config: "{{ lookup('file', 'parsed.cfg') }}" |
| 1592 |
state: parsed |
| 1593 |
|
| 1594 |
# Task output |
| 1595 |
# ----------------------- |
| 1596 |
# parsed: |
| 1597 |
# as_number: '65536' |
| 1598 |
# bgp: |
| 1599 |
# bestpath: |
| 1600 |
# med: |
| 1601 |
# confed: true |
| 1602 |
# cluster_id: '5' |
| 1603 |
# confederation: |
| 1604 |
# identifier: 4 |
| 1605 |
# router_id: 192.0.2.10 |
| 1606 |
# default_metric: 4 |
| 1607 |
# neighbors: |
| 1608 |
# - cluster_id: '3' |
| 1609 |
# neighbor_address: 192.0.2.11 |
| 1610 |
# remote_as: 65537 |
| 1611 |
# - bfd: |
| 1612 |
# fast_detect: |
| 1613 |
# strict_mode: true |
| 1614 |
# minimum_interval: 20 |
| 1615 |
# multiplier: 6 |
| 1616 |
# neighbor_address: 192.0.2.14 |
| 1617 |
# remote_as: 65538 |
| 1618 |
# socket: |
| 1619 |
# receive_buffer_size: 514 |
| 1620 |
# send_buffer_size: 4098 |
| 1621 |
|
| 1622 |
# Using gathered |
| 1623 |
# |
| 1624 |
# Before state |
| 1625 |
# ------------ |
| 1626 |
# |
| 1627 |
|
| 1628 |
# RP/0/0/CPU0:10#show running-config router bgp |
| 1629 |
# Thu Feb 4 09:38:36.245 UTC |
| 1630 |
# router bgp 65536 |
| 1631 |
# bgp confederation identifier 4 |
| 1632 |
# bgp router-id 192.0.2.10 |
| 1633 |
# bgp cluster-id 5 |
| 1634 |
# default-metric 5 |
| 1635 |
# socket send-buffer-size 4098 |
| 1636 |
# bgp bestpath med confed |
| 1637 |
# socket receive-buffer-size 514 |
| 1638 |
# neighbor 192.0.2.13 |
| 1639 |
# remote-as 65538 |
| 1640 |
# bfd fast-detect strict-mode |
| 1641 |
# bfd multiplier 6 |
| 1642 |
# bfd minimum-interval 20 |
| 1643 |
# ! |
| 1644 |
# vrf vrf1 |
| 1645 |
# default-metric 5 |
| 1646 |
# ! |
| 1647 |
# ! |
| 1648 |
|
| 1649 |
- name: Gather bgp global facts |
| 1650 |
cisco.iosxr.iosxr_bgp_global: |
| 1651 |
state: gathered |
| 1652 |
|
| 1653 |
# Task Output: |
| 1654 |
# ------------ |
| 1655 |
# |
| 1656 |
# gathered: |
| 1657 |
# as_number: '65536' |
| 1658 |
# bgp: |
| 1659 |
# bestpath: |
| 1660 |
# med: |
| 1661 |
# confed: true |
| 1662 |
# cluster_id: '5' |
| 1663 |
# confederation: |
| 1664 |
# identifier: 4 |
| 1665 |
# router_id: 192.0.2.10 |
| 1666 |
# default_metric: 5 |
| 1667 |
# neighbors: |
| 1668 |
# - bfd: |
| 1669 |
# fast_detect: |
| 1670 |
# strict_mode: true |
| 1671 |
# minimum_interval: 20 |
| 1672 |
# multiplier: 6 |
| 1673 |
# neighbor_address: 192.0.2.13 |
| 1674 |
# remote_as: 65538 |
| 1675 |
# socket: |
| 1676 |
# receive_buffer_size: 514 |
| 1677 |
# send_buffer_size: 4098 |
| 1678 |
# vrfs: |
| 1679 |
# - default_metric: 5 |
| 1680 |
# vrf: vrf1 |
| 1681 |
""" |
| 1682 |
RETURN = """ |
| 1683 |
before: |
| 1684 |
description: The configuration prior to the model invocation. |
| 1685 |
returned: always |
| 1686 |
type: dict |
| 1687 |
sample: > |
| 1688 |
The configuration returned will always be in the same format |
| 1689 |
of the parameters above. |
| 1690 |
after: |
| 1691 |
description: The resulting configuration model invocation. |
| 1692 |
returned: when changed |
| 1693 |
type: dict |
| 1694 |
sample: > |
| 1695 |
The configuration returned will always be in the same format |
| 1696 |
of the parameters above. |
| 1697 |
commands: |
| 1698 |
description: The set of commands pushed to the remote device. |
| 1699 |
returned: always |
| 1700 |
type: list |
| 1701 |
sample: |
| 1702 |
- router bgp 65536 |
| 1703 |
- bgp cluster-id 5 |
| 1704 |
- bgp router-id 192.0.2.10 |
| 1705 |
- bgp bestpath med confed |
| 1706 |
|
| 1707 |
rendered: |
| 1708 |
description: The provided configuration in the task rendered in device-native format (offline). |
| 1709 |
returned: when I(state) is C(rendered) |
| 1710 |
type: list |
| 1711 |
sample: |
| 1712 |
- router bgp 1 |
| 1713 |
- default-metric 4 |
| 1714 |
- vrf vrf3 |
| 1715 |
gathered: |
| 1716 |
description: Facts about the network resource gathered from the remote device as structured data. |
| 1717 |
returned: when I(state) is C(gathered) |
| 1718 |
type: list |
| 1719 |
sample: > |
| 1720 |
This output will always be in the same format as the |
| 1721 |
module argspec. |
| 1722 |
parsed: |
| 1723 |
description: The device native config provided in I(running_config) option parsed into structured data as per module argspec. |
| 1724 |
returned: when I(state) is C(parsed) |
| 1725 |
type: list |
| 1726 |
sample: > |
| 1727 |
This output will always be in the same format as the |
| 1728 |
module argspec. |
| 1729 |
""" |
| 1730 |
|
| 1731 |
from ansible.module_utils.basic import AnsibleModule |
| 1732 |
|
| 1733 |
from ansible_collections.cisco.iosxr.plugins.module_utils.network.iosxr.argspec.bgp_global.bgp_global import ( |
| 1734 |
Bgp_globalArgs, |
| 1735 |
) |
| 1736 |
from ansible_collections.cisco.iosxr.plugins.module_utils.network.iosxr.config.bgp_global.bgp_global import ( |
| 1737 |
Bgp_global, |
| 1738 |
) |
| 1739 |
|
| 1740 |
|
| 1741 |
def main(): |
| 1742 |
""" |
| 1743 |
Main entry point for module execution |
| 1744 |
|
| 1745 |
:returns: the result form module invocation |
| 1746 |
""" |
| 1747 |
module = AnsibleModule( |
| 1748 |
argument_spec=Bgp_globalArgs.argument_spec, |
| 1749 |
mutually_exclusive=[["config", "running_config"]], |
| 1750 |
required_if=[ |
| 1751 |
["state", "merged", ["config"]], |
| 1752 |
["state", "replaced", ["config"]], |
| 1753 |
["state", "overridden", ["config"]], |
| 1754 |
["state", "rendered", ["config"]], |
| 1755 |
["state", "parsed", ["running_config"]], |
| 1756 |
], |
| 1757 |
supports_check_mode=True, |
| 1758 |
) |
| 1759 |
|
| 1760 |
result = Bgp_global(module).execute_module() |
| 1761 |
module.exit_json(**result) |
| 1762 |
|
| 1763 |
|
| 1764 |
if __name__ == "__main__": |
| 1765 |
main() |