cisco.ios.ios_bgp_address_family module – Resource module to configure BGP Address family.

Note

This module is part of the cisco.ios collection (version 2.8.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.ios.

To use it in a playbook, specify: cisco.ios.ios_bgp_address_family.

New in version 1.2.0: of cisco.ios

Synopsis

  • This module configures and manages the attributes of bgp address family on Cisco IOS.

Parameters

Parameter

Comments

config

dictionary

A list of configurations for bgp address family.

address_family

list / elements=dictionary

A list of configurations for bgp address family.

afi

string

Address Family

Choices:

  • ipv4

  • ipv6

  • l2vpn

  • nsap

  • rtfilter

  • vpnv4

  • vpnv6

aggregate_address

list / elements=dictionary

Configure BGP aggregate entries

address

string

Aggregate address(A.B.C.D)

advertise_map

string

Set condition to advertise attribute

as_confed_set

boolean

Generate AS confed set path information

Choices:

  • no

  • yes

as_set

boolean

Generate AS set path information

Choices:

  • no

  • yes

attribute_map

string

Set attributes of aggregate

netmask

string

Aggregate mask(A.B.C.D)

summary_only

boolean

Filter more specific routes from updates

Choices:

  • no

  • yes

suppress_map

string

Conditionally filter more specific routes from updates

auto_summary

boolean

Enable automatic network number summarization

Choices:

  • no

  • yes

bgp

dictionary

Configure BGP aggregate entries

additional_paths

dictionary

Additional paths in the BGP table

receive

boolean

Receive additional paths from neighbors

Choices:

  • no

  • yes

select

dictionary

Selection criteria to pick the paths

all

boolean

Select all available paths

Choices:

  • no

  • yes

best

integer

Select best N paths (2-3).

group_best

boolean

Select group-best path

Choices:

  • no

  • yes

send

boolean

Send additional paths to neighbors

Choices:

  • no

  • yes

aggregate_timer

integer

Configure Aggregation Timer

Please refer vendor documentation for valid values

dampening

dictionary

Enable route-flap dampening

max_suppress

integer

Maximum duration to suppress a stable route

Please refer vendor documentation for valid values

penalty_half_time

integer

Half-life time for the penalty

Please refer vendor documentation for valid values

reuse_route_val

integer

Value to start reusing a route

Please refer vendor documentation for valid values

route_map

string

Route-map to specify criteria for dampening

suppress_route_val

integer

Value to start suppressing a route

Please refer vendor documentation for valid values

boolean

Use DMZ Link Bandwidth as weight for BGP multipaths

Choices:

  • no

  • yes

nexthop

dictionary

Nexthop tracking commands

route_map

string

Route map for valid nexthops

trigger

dictionary

Nexthop triggering

delay

integer

Set the delay to tigger nexthop tracking

Please refer vendor documentation for valid values

enable

boolean

Enable nexthop tracking

Choices:

  • no

  • yes

redistribute_internal

boolean

Allow redistribution of iBGP into IGPs (dangerous)

Choices:

  • no

  • yes

route_map

boolean

route-map control commands

Have route-map set commands take priority over BGP commands such as next-hop unchanged

Choices:

  • no

  • yes

scan_time

integer

Configure background scanner interval

Please refer vendor documentation for valid values

slow_peer

list / elements=dictionary

Nexthop triggering

detection

dictionary

Slow-peer detection

enable

boolean

Enable slow-peer detection

Choices:

  • no

  • yes

threshold

integer

Set the slow-peer detection threshold

Threshold value (seconds)

Please refer vendor documentation for valid values

split_update_group

dictionary

Configure slow-peer split-update-group

dynamic

boolean

Dynamically split the slow peer to slow-update group

Choices:

  • no

  • yes

permanent

boolean

Keep the slow-peer permanently in slow-update group

Choices:

  • no

  • yes

soft_reconfig_backup

boolean

Use soft-reconfiguration inbound only when route-refresh is not negotiated

Choices:

  • no

  • yes

update_group

boolean

Manage peers in bgp update groups

Split update groups based on Policy

Keep peers with as-override in different update groups

Choices:

  • no

  • yes

default

boolean

Set a command to its defaults

Choices:

  • no

  • yes

default_information

boolean

Distribution of default information

Distribute default route

Choices:

  • no

  • yes

default_metric

integer

Set metric of redistributed routes

distance

dictionary

Define an administrative distance

external

integer

Distance for routes external to the AS

internal

integer

Distance for routes internal to the AS

local

integer

Distance for local routes

neighbor

list / elements=dictionary

Specify a neighbor router

activate

boolean

Enable the Address Family for this Neighbor

Choices:

  • no

  • yes

additional_paths

dictionary

Negotiate additional paths capabilities with this neighbor

disable

boolean

Disable additional paths for this neighbor

Choices:

  • no

  • yes

receive

boolean

Receive additional paths from neighbors

Choices:

  • no

  • yes

send

boolean

Send additional paths to this neighbor

Choices:

  • no

  • yes

address

string

Neighbor address (A.B.C.D)

advertise

dictionary

Advertise to this neighbor

Advertise additional paths

all

boolean

Select all available paths

Choices:

  • no

  • yes

best

integer

Select best N paths (2-3).

group_best

boolean

Select group-best path

Choices:

  • no

  • yes

advertise_map

dictionary

specify route-map for conditional advertisement

exist_map

string

advertise prefix only if prefix is in the condition exists

condition route-map name

name

string

advertise route-map name

non_exist_map

string

advertise prefix only if prefix in the condition does not exist

condition route-map name

advertisement_interval

integer

Minimum interval between sending BGP routing updates

aigp

dictionary

Enable a AIGP on neighbor

enable

string

Enable a AIGP on neighbor

send

dictionary

Cost community or MED carrying AIGP VALUE

cost_community

dictionary

Cost extended community carrying AIGP Value

id

integer

Community ID

Please refer vendor documentation for valid values

poi

dictionary

Point of Insertion

igp_cost

boolean

Point of Insertion After IGP

Choices:

  • no

  • yes

pre_bestpath

boolean

Point of Insertion At Beginning

Choices:

  • no

  • yes

transitive

boolean

Cost community is Transitive

Choices:

  • no

  • yes

med

boolean

Med carrying AIGP Value

Choices:

  • no

  • yes

allow_policy

boolean

Enable the policy support for this IBGP Neighbor

Choices:

  • no

  • yes

allowas_in

integer

Accept as-path with my AS present in it

Please refer vendor documentation for valid values

as_override

dictionary

Override matching AS-number while sending update

set

boolean

Enable AS override

Choices:

  • no

  • yes

split_horizon

boolean

Maintain Split Horizon while sending update

Choices:

  • no

  • yes

bmp_activate

dictionary

Activate the BMP monitoring for a BGP peer

all

boolean

Activate BMP monitoring for all servers

Choices:

  • no

  • yes

server

integer

Activate BMP for server

BMP Server Number

Please refer vendor documentation for valid values

capability

dictionary

Advertise capability to the peer

Advertise ORF capability to the peer

Advertise prefixlist ORF capability to this neighbor

both

boolean

Capability to SEND and RECEIVE the ORF to/from this neighbor

Choices:

  • no

  • yes

receive

boolean

Capability to RECEIVE the ORF from this neighbor

Choices:

  • no

  • yes

send

boolean

Capability to SEND the ORF to this neighbor

Choices:

  • no

  • yes

cluster_id

string

Configure Route-Reflector Cluster-id (peers may reset)

Route-Reflector Cluster-id as 32 bit quantity, or Route-Reflector Cluster-id in IP address format (A.B.C.D)

default_originate

dictionary

Originate default route to this neighbor

route_map

string

Route-map to specify criteria to originate default

set

boolean

Set default route to this neighbor

Choices:

  • no

  • yes

description

string

Neighbor specific description

disable_connected_check

boolean

one-hop away EBGP peer using loopback address

Choices:

  • no

  • yes

distribute_list

dictionary

Filter updates to/from this neighbor

acl

string

ACL id/name

in

boolean

Filter incoming updates

Choices:

  • no

  • yes

out

boolean

Filter outgoing updates

Choices:

  • no

  • yes

boolean

Propagate the DMZ link bandwidth

Choices:

  • no

  • yes

ebgp_multihop

dictionary

Allow EBGP neighbors not on directly connected networks

enable

boolean

Allow EBGP neighbors not on directly connected networks

Choices:

  • no

  • yes

hop_count

integer

Maximum hop count

Please refer vendor documentation for valid values

fall_over

dictionary

Session fall on peer route lost

bfd

dictionary

Use BFD to detect failure

multi_hop

boolean

Force BFD multi-hop to detect failure

Choices:

  • no

  • yes

set

boolean

set bfd

Choices:

  • no

  • yes

single_hop

boolean

Force BFD single-hop to detect failure

Choices:

  • no

  • yes

route_map

string

Route map for peer route

filter_list

dictionary

Establish BGP filters

as_path_acl

integer

AS path access list

Please refer vendor documentation for valid values

in

boolean

Filter incoming updates

Choices:

  • no

  • yes

out

boolean

Filter outgoing updates

Choices:

  • no

  • yes

ha_mode

dictionary

high availability mode

disable

boolean

disable graceful-restart

Choices:

  • no

  • yes

set

boolean

set ha-mode and graceful-restart for this peer

Choices:

  • no

  • yes

inherit

string

Inherit a template

Inherit a peer-policy template

internal_vpn_client

boolean

Stack iBGP-CE Neighbor Path in ATTR_SET for vpn update

Choices:

  • no

  • yes

ipv6_adddress

aliases: ipv6_address

string

Neighbor ipv6 address (X:X:X:X::X)

local_as

dictionary

Specify a local-as number

dual_as

boolean

Accept either real AS or local AS from the ebgp peer

Choices:

  • no

  • yes

no_prepend

dictionary

Do not prepend local-as to updates from ebgp peers

replace_as

boolean

Replace real AS with local AS in the EBGP updates

Choices:

  • no

  • yes

set

boolean

Set prepend

Choices:

  • no

  • yes

number

integer

AS number used as local AS

Please refer vendor documentation for valid values

set

boolean

set local-as number

Choices:

  • no

  • yes

log_neighbor_changes

dictionary

Log neighbor up/down and reset reason

disable

boolean

disable Log neighbor up/down and reset

Choices:

  • no

  • yes

set

boolean

set Log neighbor up/down and reset

Choices:

  • no

  • yes

maximum_prefix

dictionary

Establish BGP filters

number

integer

maximum no. of prefix limit

Please refer vendor documentation for valid values

restart

integer

Restart bgp connection after limit is exceeded

threshold_value

integer

Threshold value (%) at which to generate a warning msg

Please refer vendor documentation for valid values

warning_only

boolean

Only give warning message when limit is exceeded

Choices:

  • no

  • yes

next_hop_self

boolean

Disable the next hop calculation for this neighbor

This option is DEPRECATED and is replaced with nexthop_self which accepts dict as input this attribute will be removed after 2023-06-01.

Choices:

  • no

  • yes

next_hop_unchanged

boolean

Propagate next hop unchanged for iBGP paths to this neighbor

Choices:

  • no

  • yes

nexthop_self

dictionary

Disable the next hop calculation for this neighbor

all

boolean

Enable next-hop-self for both eBGP and iBGP received paths

Choices:

  • no

  • yes

set

boolean

set the next hop self

Choices:

  • no

  • yes

password

string

Set a password

path_attribute

dictionary

BGP optional attribute filtering

discard

dictionary

Discard matching path-attribute for this neighbor

in

boolean

Perform inbound path-attribute filtering

Choices:

  • no

  • yes

range

dictionary

path attribute range

end

integer

path attribute range end value

Please refer vendor documentation for valid values

start

integer

path attribute range start value

Please refer vendor documentation for valid values

type

integer

path attribute type

Please refer vendor documentation for valid values

treat_as_withdraw

dictionary

Treat-as-withdraw matching path-attribute for this neighbor

in

boolean

Perform inbound path-attribute filtering

Choices:

  • no

  • yes

range

dictionary

path attribute range

end

integer

path attribute range end value

Please refer vendor documentation for valid values

start

integer

path attribute range start value

Please refer vendor documentation for valid values

type

integer

path attribute type

Please refer vendor documentation for valid values

peer_group

boolean

Member of the peer-group

Choices:

  • no

  • yes

prefix_list

dictionary

Filter updates to/from this neighbor

This option is DEPRECATED and is replaced with prefix_lists which accepts list of dict as input

in

boolean

Filter incoming updates

Choices:

  • no

  • yes

name

string

Name of a prefix list

out

boolean

Filter outgoing updates

Choices:

  • no

  • yes

prefix_lists

list / elements=dictionary

Filter updates to/from this neighbor

in

boolean

Filter incoming updates

Choices:

  • no

  • yes

name

string

Name of a prefix list

out

boolean

Filter outgoing updates

Choices:

  • no

  • yes

remote_as

integer

Specify a BGP neighbor

AS of remote neighbor

remove_private_as

dictionary

Remove private AS number from outbound updates

all

boolean

Remove all private AS numbers

Choices:

  • no

  • yes

replace_as

boolean

Replace all private AS numbers with local AS

Choices:

  • no

  • yes

set

boolean

Remove private AS number from outbound updates

Choices:

  • no

  • yes

route_map

dictionary

Apply route map to neighbor

This option is DEPRECATED and is replaced with route_maps which accepts list of dict as input

in

boolean

Apply map to incoming routes

Choices:

  • no

  • yes

name

string

Name of route map

out

boolean

Apply map to outbound routes

Choices:

  • no

  • yes

route_maps

list / elements=dictionary

Apply route map to neighbor

in

boolean

Apply map to incoming routes

Choices:

  • no

  • yes

name

string

Name of route map

out

boolean

Apply map to outbound routes

Choices:

  • no

  • yes

route_reflector_client

boolean

Configure a neighbor as Route Reflector client

Choices:

  • no

  • yes

route_server_client

boolean

Configure a neighbor as Route Server client

Choices:

  • no

  • yes

send_community

dictionary

Send Community attribute to this neighbor

both

boolean

Send Standard and Extended Community attributes

Choices:

  • no

  • yes

extended

boolean

Send Extended Community attribute

Choices:

  • no

  • yes

set

boolean

Send Standard Community attribute.

Maintains backwards compatibility for configurations that do not specify a send-community type.

Choices:

  • no

  • yes

standard

boolean

Send Standard Community attribute

Choices:

  • no

  • yes

shutdown

dictionary

Administratively shut down this neighbor

graceful

integer

Gracefully shut down this neighbor

time in seconds

Please refer vendor documentation for valid values

set

boolean

shut down

Choices:

  • no

  • yes

slow_peer

list / elements=dictionary

Configure slow-peer

detection

dictionary

Configure slow-peer

disable

boolean

Disable slow-peer detection

Choices:

  • no

  • yes

enable

boolean

Enable slow-peer detection

Choices:

  • no

  • yes

threshold

integer

Set the slow-peer detection threshold

split_update_group

dictionary

Configure slow-peer

dynamic

dictionary

Configure slow-peer

disable

boolean

Configure slow-peer

Choices:

  • no

  • yes

enable

boolean

Configure slow-peer

Choices:

  • no

  • yes

permanent

boolean

Configure slow-peer

Choices:

  • no

  • yes

static

boolean

Configure slow-peer

Choices:

  • no

  • yes

soft_reconfiguration

boolean

Per neighbor soft reconfiguration

Allow inbound soft reconfiguration for this neighbor

Choices:

  • no

  • yes

soo

string

Site-of-Origin extended community

tag

string

Neighbor tag

timers

dictionary

BGP per neighbor timers

holdtime

integer

Holdtime

interval

integer

Keepalive interval

min_holdtime

integer

Minimum hold time from neighbor

transport

dictionary

Transport options

connection_mode

dictionary

Specify passive or active connection

active

boolean

Actively establish the TCP session

Choices:

  • no

  • yes

passive

boolean

Passively establish the TCP session

Choices:

  • no

  • yes

multi_session

boolean

Use Multi-session for transport

Choices:

  • no

  • yes

path_mtu_discovery

dictionary

Use transport path MTU discovery

disable

boolean

disable

Choices:

  • no

  • yes

set

boolean

Use path MTU discovery

Choices:

  • no

  • yes

ttl_security

integer

BGP ttl security check

maximum number of hops

Please refer vendor documentation for valid values

unsuppress_map

string

Route-map to selectively unsuppress suppressed routes

version

integer

Set the BGP version to match a neighbor

Neighbor’s BGP version

Please refer vendor documentation for valid values

weight

integer

Set default weight for routes from this neighbor

network

list / elements=dictionary

Specify a network to announce via BGP

address

string

Network number (A.B.C.D)

backdoor

boolean

Specify a BGP backdoor route

Choices:

  • no

  • yes

mask

string

Network mask (A.B.C.D)

route_map

string

Route-map to modify the attributes

redistribute

list / elements=dictionary

Redistribute information from another routing protocol

application

dictionary

Application

metric

integer

Metric for redistributed routes

name

string

Application name

route_map

string

Route map reference

bgp

dictionary

Border Gateway Protocol (BGP)

as_number

string

Autonomous system number

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

connected

dictionary

Connected

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

set

boolean

Redistribute automatically established IP connected routes.

This only needs to be set if metric or route_map aren’t used.

Choices:

  • no

  • yes

eigrp

dictionary

Enhanced Interior Gateway Routing Protocol (EIGRP)

as_number

string

Autonomous system number

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

isis

dictionary

ISO IS-IS

area_tag

string

ISO routing area tag

clns

boolean

Redistribution of OSI dynamic routes

Choices:

  • no

  • yes

ip

boolean

Redistribution of IP dynamic routes

Choices:

  • no

  • yes

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

iso_igrp

dictionary

IGRP for OSI networks

area_tag

string

ISO routing area tag

route_map

string

Route map reference

lisp

dictionary

Locator ID Separation Protocol (LISP)

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

mobile

dictionary

Mobile routes

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

odr

dictionary

On Demand stub Routes

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

ospf

dictionary

Open Shortest Path First (OSPF)

match

dictionary

On Demand stub Routes

external

boolean

Redistribute OSPF external routes

Choices:

  • no

  • yes

internal

boolean

Redistribute OSPF internal routes

Choices:

  • no

  • yes

nssa_external

boolean

Redistribute OSPF NSSA external routes

Choices:

  • no

  • yes

type_1

boolean

Redistribute NSSA external type 1 routes

Choices:

  • no

  • yes

type_2

boolean

Redistribute NSSA external type 2 routes

Choices:

  • no

  • yes

metric

integer

Metric for redistributed routes

process_id

integer

Process ID

route_map

string

Route map reference

vrf

string

VPN Routing/Forwarding Instance

ospfv3

dictionary

OSPFv3

match

dictionary

On Demand stub Routes

external

boolean

Redistribute OSPF external routes

Choices:

  • no

  • yes

internal

boolean

Redistribute OSPF internal routes

Choices:

  • no

  • yes

nssa_external

boolean

Redistribute OSPF NSSA external routes

Choices:

  • no

  • yes

type_1

boolean

Redistribute NSSA external type 1 routes

Choices:

  • no

  • yes

type_2

boolean

Redistribute NSSA external type 2 routes

Choices:

  • no

  • yes

metric

integer

Metric for redistributed routes

process_id

integer

Process ID

route_map

string

Route map reference

rip

dictionary

Routing Information Protocol (RIP)

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

static

dictionary

Static routes

clns

boolean

Redistribution of OSI static routes

Choices:

  • no

  • yes

ip

boolean

Redistribution of IP static routes

Choices:

  • no

  • yes

metric

integer

Metric for redistributed routes

route_map

string

Route map reference

vrf

dictionary

Specify a source VRF

global

boolean

global VRF

Choices:

  • no

  • yes

name

string

Source VRF name

safi

string

Address Family modifier

Choices:

  • flowspec

  • mdt

  • multicast

  • mvpn

  • evpn

  • unicast

snmp

dictionary

Modify snmp parameters

context

dictionary

Configure a SNMP context

Context Name

community

dictionary

Configure a SNMP v2c Community string and access privs

acl

string

Standard IP accesslist allowing access with this community string

Expanded IP accesslist allowing access with this community string

Access-list name

ipv6

string

Specify IPv6 Named Access-List

IPv6 Access-list name

ro

boolean

Read-only access with this community string

Choices:

  • no

  • yes

rw

boolean

Read-write access with this community string

Choices:

  • no

  • yes

snmp_community

string

SNMP community string

name

string

Context Name

user

dictionary

Configure a SNMP v3 user

access

dictionary

specify an access-list associated with this group

acl

string

SNMP community string

ipv6

string

Specify IPv6 Named Access-List

IPv6 Access-list name

auth

dictionary

authentication parameters for the user

md5

string

Use HMAC MD5 algorithm for authentication

authentication password for user

sha

string

Use HMAC SHA algorithm for authentication

authentication password for user

credential

boolean

If the user password is already configured and saved

Choices:

  • no

  • yes

encrypted

boolean

specifying passwords as MD5 or SHA digests

Choices:

  • no

  • yes

name

string

SNMP community string

priv

dictionary

encryption parameters for the user

des

string

Use 56 bit DES algorithm for encryption

table_map

dictionary

Map external entry attributes into routing table

filter

boolean

Selective route download

Choices:

  • no

  • yes

name

string

route-map name

vrf

string

Specify parameters for a VPN Routing/Forwarding instance

as_number

string

Autonomous system number.

running_config

string

This option is used only with state parsed.

The value of this option should be the output received from the IOS device by executing the command sh running-config | section ^router bgp.

The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module’s argspec and the value is then returned in the parsed key within the result.

state

string

The state the configuration should be left in

The states rendered, gathered and parsed does not perform any change on the device.

The state rendered will transform the configuration in config option to platform specific CLI commands which will be returned in the rendered key within the result. For state rendered active connection to remote host is not required.

The state gathered will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the gathered key within the result.

The state parsed reads the configuration from running_config option and transforms it into JSON format as per the resource module parameters and the value is returned in the parsed key within the result. The value of running_config option should be the same format as the output of command show running-config | include ip route|ipv6 route executed on device. For state parsed active connection to remote host is not required.

Choices:

  • merged ← (default)

  • replaced

  • overridden

  • deleted

  • gathered

  • rendered

  • parsed

Notes

Note

Examples

# Using merged

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20

- name: Merge provided configuration with device configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.100.1
              aigp:
                send:
                  cost_community:
                    id: 100
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
              route_map:
                - name: test-route-out
                  out: true
                - name: test-route-in
                  in: true
              route_server_client: true
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
          snmp:
            context:
              name: snmp_con
              community:
                snmp_community: community
                ro: true
                acl: 10
        - afi: ipv4
          safi: mdt
          bgp:
            dmzlink_bw: true
            dampening:
              penalty_half_time: 1
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 5
            soft_reconfig_backup: true
        - afi: ipv4
          safi: multicast
          aggregate_address:
            - address: 192.0.3.1
              netmask: 255.255.255.255
              as_confed_set: true
          default_metric: 12
          distance:
            external: 10
            internal: 10
            local: 100
          network:
            - address: 198.51.111.11
              mask: 255.255.255.255
              route_map: test
          table_map:
            name: test_tableMap
            filter: true
    state: merged

# Commands fired:
# ---------------
# "commands": [
#     "router bgp 65000",
#     "address-family ipv4 multicast vrf blue",
#     "bgp aggregate-timer 10",
#     "bgp slow-peer detection threshold 150",
#     "bgp dampening 1 1 1 1",
#     "neighbor 198.51.100.1 remote-as 10",
#     "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
#     "neighbor 198.51.100.1 route-map test-route out",
#     "neighbor 198.51.100.1 route-server-client",
#     "neighbor 198.51.100.1 slow-peer detection threshold 150",
#     "network 198.51.110.10 mask 255.255.255.255 backdoor",
#     "snmp context snnmp_con_1 community community ro 10",
#     "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
#     "exit-address-family",
#     "address-family ipv4 mdt",
#     "bgp dmzlink-bw",
#     "bgp dampening 1 10 100 5",
#     "bgp soft-reconfig-backup",
#     "exit-address-family",
#     "address-family ipv4 multicast",
#     "network 1.1.1.1 mask 255.255.255.255 route-map test",
#     "aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
#     "default-metric 12",
#     "distance bgp 10 10 100",
#     "table-map test_tableMap filter"
#     "exit-address-family",
# ]

# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

# Using replaced

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

- name: Replaces device configuration of listed AF BGP with provided configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.110.1
              activate: true
              aigp:
                send:
                  cost_community:
                    id: 200
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
              route_maps:
                - name: test-replaced-route
                  out: true
              route_server_client: true
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
        - afi: ipv4
          safi: multicast
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 10
              max_suppress: 10
            slow_peer:
              - detection:
                  threshold: 200
          network:
            - address: 192.0.2.1
              mask: 255.255.255.255
              route_map: test
    state: replaced

# Commands fired:
# ---------------
# "commands": [
#         "router bgp 65000",
#         "address-family ipv4 multicast vrf blue",
#         "neighbor 198.51.110.1 remote-as 10",
#         "neighbor 198.51.110.1 activate",
#         "neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive",
#         "neighbor 198.51.110.1 route-map test-replaced-route out",
#         "neighbor 198.51.110.1 route-server-client",
#         "neighbor 198.51.110.1 slow-peer detection threshold 150",
#         "no neighbor 198.51.100.1 remote-as 10",
#         "no neighbor 198.51.100.1 activate",
#         "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
#         "no neighbor 198.51.100.1 route-map test-route out",
#         "no neighbor 198.51.100.1 route-server-client",
#         "no neighbor 198.51.100.1 slow-peer detection threshold 150",
#         "exit-address-family",
#         "address-family ipv4 multicast",
#         "bgp aggregate-timer 10",
#         "bgp slow-peer detection threshold 200",
#         "bgp dampening 10 10 10 10",
#         "network 192.0.2.1 mask 255.255.255.255 route-map test",
#         "no network 1.1.1.1 mask 255.255.255.255 route-map test",
#         "no aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
#         "no default-metric 12",
#         "no distance bgp 10 10 100",
#         "no table-map test_tableMap filter"
#         "exit-address-family",
#     ]

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 192.0.2.1 mask 255.255.255.255 route-map test
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.110.1 remote-as 10
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
#   neighbor 198.51.110.1 route-server-client
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 route-map test-replaced-route out
#  exit-address-family

# Using overridden

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

- name: Override device configuration of all AF BGP with provided configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 50
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.110.1
              activate: true
              log_neighbor_changes:
                disable: true
              maximum_prefix:
                number: 1
                threshold_value: 10
                restart: 100
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 100
              route_maps:
                - name: test-override-route
                  out: true
              route_server_client: true
              version: 4
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
        - afi: ipv6
          safi: multicast
          default_information: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 10
              reuse_route_val: 10
              suppress_route_val: 10
              max_suppress: 10
            slow_peer:
              - detection:
                  threshold: 200
          network:
            - address: 2001:DB8:0:3::/64
              route_map: test_ipv6
    state: overridden

# Commands fired:
# ---------------
# "commands": [
#       "router bgp 65000",
#       "no address-family ipv4 multicast",
#       "no address-family ipv4 mdt",
#       "address-family ipv4 multicast vrf blue",
#       "bgp aggregate-timer 10",
#       "bgp slow-peer detection threshold 150",
#       "bgp dampening 10 10 100 50",
#       "neighbor 198.51.110.1 remote-as 100",
#       "neighbor 198.51.110.1 activate",
#       "neighbor 198.51.110.1 log-neighbor-changes disable",
#       "neighbor 198.51.110.1 maximum-prefix 1 10 restart 100",
#       "neighbor 198.51.110.1 route-map test-override-route out",
#       "neighbor 198.51.110.1 route-server-client",
#       "neighbor 198.51.110.1 version 4",
#       "neighbor 198.51.110.1 slow-peer detection threshold 150",
#       "network 198.51.110.10 mask 255.255.255.255 backdoor",
#       "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
#       "exit-address-family",
#       "address-family ipv6 multicast",
#       "bgp aggregate-timer 10",
#       "bgp slow-peer detection threshold 200",
#       "bgp dampening 10 10 10 10",
#       "network 2001:DB8:0:3::/64 route-map test_ipv6"
#       "exit-address-family",
#   ]

# 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
#  snmp context snnmp_con_1 community community RO 10
#  neighbor 192.0.2.1 remote-as 100
#  neighbor 192.0.2.1 description replace neighbor
#  neighbor 198.51.100.1 remote-as 10
#  !
#  address-family ipv6 multicast
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 200
#   bgp dampening 10 10 10 10
#   network 2001:DB8:0:3::/64 route-map test_ipv6
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 10 10 100 50
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.110.1 remote-as 100
#   neighbor 198.51.110.1 log-neighbor-changes disable
#   neighbor 198.51.110.1 version 4
#   neighbor 198.51.110.1 activate
#   neighbor 198.51.110.1 route-server-client
#   neighbor 198.51.110.1 slow-peer detection threshold 150
#   neighbor 198.51.110.1 route-map test-override-route out
#   neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
#  exit-address-family

# Using Deleted

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

- name: "Delete AF BGP (Note: This won't delete the all configured AF BGP)"
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
        - afi: ipv4
          safi: mdt
    state: deleted

# Commands fired:
# ---------------
# "commands": [
#       "router bgp 65000",
#       "no address-family ipv4 multicast",
#       "no address-family ipv4 mdt"
#   ]

# After state:
# -------------
#
# vios#sh running-config | section ^router bg
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

# Using Deleted without any config passed
#"(NOTE: This will delete all of configured AF BGP)"

# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !
#  address-family ipv4 multicast vrf blue
#   bgp aggregate-timer 10
#   bgp slow-peer detection threshold 150
#   bgp dampening 1 1 1 1
#   network 198.51.110.10 mask 255.255.255.255 backdoor
#   aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
#   neighbor 198.51.100.1 remote-as 10
#   neighbor 198.51.100.1 activate
#   neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
#   neighbor 198.51.100.1 route-server-client
#   neighbor 198.51.100.1 slow-peer detection threshold 150
#   neighbor 198.51.100.1 route-map test-route out
#  exit-address-family

- name: 'Delete ALL of configured AF BGP (Note: This WILL delete the all configured
    AF BGP)'
  cisco.ios.ios_bgp_address_family:
    state: deleted

# Commands fired:
# ---------------
# "commands": [
#       "router bgp 65000",
#       "no address-family ipv4 multicast vrf blue",
#       "no address-family ipv4 multicast",
#       "no address-family ipv4 mdt"
#   ]

# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20

# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp

- name: Gather listed AF BGP with provided configurations
  cisco.ios.ios_bgp_address_family:
    config:
    state: gathered

# Module Execution Result:
# ------------------------
#
# "gathered": {
#       "address_family": [
#           {
#               "afi": "ipv4",
#               "aggregate_address": [{
#                   "address": "192.0.2.1",
#                   "as_confed_set": true,
#                   "netmask": "255.255.255.255"
#               }],
#               "bgp": {
#                   "aggregate_timer": 10,
#                   "dampening": {
#                       "max_suppress": 1,
#                       "penalty_half_time": 1,
#                       "reuse_route_val": 1,
#                       "suppress_route_val": 1
#                   },
#                   "slow_peer": [
#                       {
#                           "detection": {
#                               "threshold": 150
#                           }
#                       }
#                   ]
#               },
#               "neighbor": [
#                   {
#                       "activate": true,
#                       "address": "198.51.100.1",
#                       "aigp": {
#                           "send": {
#                               "cost_community": {
#                                   "id": 100,
#                                   "poi": {
#                                       "igp_cost": true,
#                                       "transitive": true
#                                   }
#                               }
#                           }
#                       },
#                       "remote_as": 10,
#                       "route_maps": [{
#                           "name": "test-route",
#                           "out": true
#                       }],
#                       "route_server_client": true,
#                       "slow_peer": [
#                           {
#                               "detection": {
#                                   "threshold": 150
#                               }
#                           }
#                       ]
#                   }
#               ],
#               "network": [
#                   {
#                       "address": "198.51.110.10",
#                       "backdoor": true,
#                       "mask": "255.255.255.255"
#                   }
#               ],
#               "safi": "multicast",
#               "snmp": {
#                   "context": {
#                       "community": {
#                           "acl": "10",
#                           "ro": true,
#                           "snmp_community": "community"
#                       },
#                       "name": "snnmp_con_1"
#                   }
#               },
#               "vrf": "blue"
#           },
#           {
#               "afi": "ipv4",
#               "aggregate_address": [{
#                   "address": "192.0.3.1",
#                   "as_confed_set": true,
#                   "netmask": "255.255.255.255"
#               }],
#               "default_metric": 12,
#               "distance": {
#                   "external": 10,
#                   "internal": 10,
#                   "local": 100
#               },
#               "network": [
#                   {
#                       "address": "1.1.1.1",
#                       "mask": "255.255.255.255",
#                       "route_map": "test"
#                   }
#               ],
#               "safi": "multicast",
#               "table_map": {
#                   "filter": true,
#                   "name": "test_tableMap"
#               }
#           },
#           {
#               "afi": "ipv4",
#               "bgp": {
#                   "dampening": {
#                       "max_suppress": 5,
#                       "penalty_half_time": 1,
#                       "reuse_route_val": 10,
#                       "suppress_route_val": 100
#                   },
#                   "dmzlink_bw": true,
#                   "soft_reconfig_backup": true
#               },
#               "safi": "mdt"
#           }
#       ],
#       "as_number": "65000"
#   }

# Using Rendered

- name: Rendered the provided configuration with the existing running configuration
  cisco.ios.ios_bgp_address_family:
    config:
      as_number: 65000
      address_family:
        - afi: ipv4
          safi: multicast
          vrf: blue
          aggregate_address:
            - address: 192.0.2.1
              netmask: 255.255.255.255
              as_confed_set: true
          bgp:
            aggregate_timer: 10
            dampening:
              penalty_half_time: 1
              reuse_route_val: 1
              suppress_route_val: 1
              max_suppress: 1
            slow_peer:
              - detection:
                  threshold: 150
          neighbor:
            - address: 198.51.100.1
              aigp:
                send:
                  cost_community:
                    id: 100
                    poi:
                      igp_cost: true
                      transitive: true
              slow_peer:
                - detection:
                    threshold: 150
              remote_as: 10
              route_maps:
                - name: test-route
                  out: true
              route_server_client: true
          network:
            - address: 198.51.110.10
              mask: 255.255.255.255
              backdoor: true
          snmp:
            context:
              name: snmp_con
              community:
                snmp_community: community
                ro: true
                acl: 10
        - afi: ipv4
          safi: mdt
          bgp:
            dmzlink_bw: true
            dampening:
              penalty_half_time: 1
              reuse_route_val: 10
              suppress_route_val: 100
              max_suppress: 5
            soft_reconfig_backup: true
    state: rendered

# Module Execution Result:
# ------------------------
#
# "rendered": [
#     "router bgp 65000",
#     "address-family ipv4 multicast vrf blue",
#     "bgp aggregate-timer 10",
#     "bgp slow-peer detection threshold 150",
#     "bgp dampening 1 1 1 1",
#     "neighbor 198.51.100.1 remote-as 10",
#     "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
#     "neighbor 198.51.100.1 route-map test-route out",
#     "neighbor 198.51.100.1 route-server-client",
#     "neighbor 198.51.100.1 slow-peer detection threshold 150",
#     "network 198.51.110.10 mask 255.255.255.255 backdoor",
#     "snmp context snnmp_con_1 community community ro 10",
#     "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
#     "exit-address-family",
#     "address-family ipv4 mdt",
#     "bgp dmzlink-bw",
#     "bgp dampening 1 10 100 5",
#     "bgp soft-reconfig-backup"
#     "exit-address-family",
# ]

# Using Parsed

# File: parsed.cfg
# ----------------
# router bgp 65000
#  bgp log-neighbor-changes
#  bgp nopeerup-delay cold-boot 20
#  !
#  address-family ipv4 multicast
#   table-map test_tableMap filter
#   network 1.1.1.1 mask 255.255.255.255 route-map test
#   aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
#   default-metric 12
#   distance bgp 10 10 100
#  exit-address-family
#  !
#  address-family ipv4 mdt
#   bgp dampening 1 10 100 5
#   bgp dmzlink-bw
#   bgp soft-reconfig-backup
#  exit-address-family
#  !

- name: Parse the commands for provided configuration
  cisco.ios.ios_bgp_address_family:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Module Execution Result:
# ------------------------
#
# "parsed": {
#       "address_family": [
#           {
#               "afi": "ipv4",
#               "aggregate_address": [{
#                   "address": "192.0.3.1",
#                   "as_confed_set": true,
#                   "netmask": "255.255.255.255"
#               }],
#               "default_metric": 12,
#               "distance": {
#                   "external": 10,
#                   "internal": 10,
#                   "local": 100
#               },
#               "network": [
#                   {
#                       "address": "1.1.1.1",
#                       "mask": "255.255.255.255",
#                       "route_map": "test"
#                   }
#               ],
#               "safi": "multicast",
#               "table_map": {
#                   "filter": true,
#                   "name": "test_tableMap"
#               }
#           },
#           {
#               "afi": "ipv4",
#               "bgp": {
#                   "dampening": {
#                       "max_suppress": 5,
#                       "penalty_half_time": 1,
#                       "reuse_route_val": 10,
#                       "suppress_route_val": 100
#                   },
#                   "dmzlink_bw": true,
#                   "soft_reconfig_backup": true
#               },
#               "safi": "mdt"
#           }
#       ],
#       "as_number": "65000"
#   }

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

dictionary

The resulting configuration after module execution.

Returned: when changed

Sample: “This output will always be in the same format as the module argspec.\n”

before

dictionary

The configuration prior to the module execution.

Returned: when state is merged, replaced, overridden, deleted or purged

Sample: “This output will always be in the same format as the module argspec.\n”

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: when state is merged, replaced, overridden, deleted or purged

Sample: [“router bgp 65000”, “address-family ipv4 multicast”, “table-map test_tableMap filter”, “network 1.1.1.1 mask 255.255.255.255 route-map test”, “aggregate-address 192.0.3.1 255.255.255.255 as-confed-set”]

gathered

list / elements=string

Facts about the network resource gathered from the remote device as structured data.

Returned: when state is gathered

Sample: “This output will always be in the same format as the module argspec.\n”

parsed

list / elements=string

The device native config provided in running_config option parsed into structured data as per module argspec.

Returned: when state is parsed

Sample: “This output will always be in the same format as the module argspec.\n”

rendered

list / elements=string

The provided configuration in the task rendered in device-native format (offline).

Returned: when state is rendered

Sample: [“router bgp 65000”, “address-family ipv4 multicast”, “table-map test_tableMap filter”, “network 1.1.1.1 mask 255.255.255.255 route-map test”, “aggregate-address 192.0.3.1 255.255.255.255 as-confed-set”]

Authors

  • Sumit Jaiswal (@justjais)