cisco.ios.ios_bgp_global – Global BGP resource module¶
Note
This plugin is part of the cisco.ios collection (version 1.3.0).
To install it use: ansible-galaxy collection install cisco.ios
.
To use it in a playbook, specify: cisco.ios.ios_bgp_global
.
New in version 1.3.0: of cisco.ios
Synopsis¶
This module configures and manages the attributes of global bgp on Cisco IOS.
Note
This module has a corresponding action plugin.
Parameters¶
Examples¶
# Using merged
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
- name: Merge provided configuration with device configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: merged
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Replaces device configuration of listed global BGP with provided configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- med:
confed: true
log_neighbor_changes: true
nopeerup_delay:
- post_boot: 10
cold_boot: 20
neighbor:
- address: 192.0.2.1
description: replace neighbor
remote_as: 100
slow_peer:
detection:
disable: true
state: replaced
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000"
# "no bgp dampening 1 1 1 1"
# "no timers bgp 100 200 150"
# "no bgp bestpath compare-routerid"
# "bgp bestpath med confed"
# "bgp nopeerup-delay cold-boot 20"
# "no neighbor 198.51.100.1 remote-as 100"
# "neighbor 192.0.2.1 remote-as 100"
# "no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100"
# "no neighbor 198.51.100.1 route-map test-route out"
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive"
# "no neighbor 198.51.100.1 description merge neighbor"
# "neighbor 192.0.2.1 slow-peer detection disable"
# "neighbor 192.0.2.1 description replace neighbor"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# bgp nopeerup-delay post-boot 10
# bgp bestpath med confed
# bgp advertise-best-external
# redistribute connected metric 10
# neighbor 192.0.2.1 remote-as 100
# neighbor 192.0.2.1 description replace neighbor
# neighbor 192.0.2.1 slow-peer detection disable
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP (Note: This won't delete the configured global BGP)"
cisco.ios.ios_bgp_global:
config:
as_number: 65000
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP without config"
cisco.ios.ios_bgp_global:
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Purged
#"(NOTE: This WILL delete the configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: 'Delete the configured global BGP (Note: This WILL delete the the configured
global BGP)'
cisco.ios.ios_bgp_global:
state: purged
# Commands fired:
# ---------------
# "commands": [
# "no router bgp 65000",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Gather listed global BGP with provided configurations
cisco.ios.ios_bgp_global:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
# Using Rendered
- name: Rendered the provided configuration with the exisiting running configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Parse the commands for provided configuration
cisco.ios.ios_bgp_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Sumit Jaiswal (@justjais)