cisco.nxos.nxos_bgp_neighbor_address_family (7.0.0) — module

BGP Neighbor Address Family resource module.

| "added in version" 2.0.0 of cisco.nxos"

Authors: Nilashish Chakraborty (@NilashishC)

Install collection

Install with ansible-galaxy collection install cisco.nxos:==7.0.0


Add to requirements.yml

  collections:
    - name: cisco.nxos
      version: 7.0.0

Description

This module manages BGP Neighbor Address Family configuration on devices running Cisco NX-OS.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using merged

# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# Nexus9000v#

- name: Merge the provided configuration with the existing running configuration
  cisco.nxos.nxos_bgp_neighbor_address_family: &id001
    config:
      as_number: 65536
      neighbors:
        - neighbor_address: 192.0.2.32
          address_family:
            - afi: ipv4
              safi: unicast
              maximum_prefix:
                max_prefix_limit: 20
                generate_warning_threshold: 75
              weight: 100
              prefix_list:
                inbound: rmap1
                outbound: rmap2
            - afi: ipv6
              safi: unicast
        - neighbor_address: 192.0.2.33
          address_family:
            - afi: ipv4
              safi: multicast
              inherit:
                template: BasePolicy
                sequence: 200
      vrfs:
        - vrf: site-1
          neighbors:
            - neighbor_address: 203.0.113.1
              address_family:
                - afi: ipv4
                  safi: unicast
                  suppress_inactive: true
                  next_hop_self:
                    set: true
            - neighbor_address: 203.0.113.2
              address_family:
                - afi: ipv6
                  safi: unicast
                - afi: ipv4
                  safi: multicast
                  send_community:
                    set: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  before: {}
#
#  commands:
#  - router bgp 65536
#  - neighbor 192.0.2.32
#  - address-family ipv4 unicast
#  - maximum-prefix 20 75
#  - weight 100
#  - prefix-list rmap1 in
#  - prefix-list rmap2 out
#  - address-family ipv6 unicast
#  - neighbor 192.0.2.33
#  - address-family ipv4 multicast
#  - inherit peer-policy BasePolicy 200
#  - vrf site-1
#  - neighbor 203.0.113.1
#  - address-family ipv4 unicast
#  - suppress-inactive
#  - next-hop-self
#  - neighbor 203.0.113.2
#  - address-family ipv6 unicast
#  - address-family ipv4 multicast
#  - send-community
#
#  after:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            maximum_prefix:
#              max_prefix_limit: 20
#              generate_warning_threshold: 75
#            weight: 100
#            prefix_list:
#              inbound: rmap1
#              outbound: rmap2
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast

# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

# Using replaced

# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

- name: Replace specified neighbor AFs with given configuration
  cisco.nxos.nxos_bgp_neighbor_address_family: &replaced
    config:
      as_number: 65536
      neighbors:
        - neighbor_address: 192.0.2.32
          address_family:
            - afi: ipv4
              safi: unicast
              weight: 110
            - afi: ipv6
              safi: unicast
        - neighbor_address: 192.0.2.33
          address_family:
            - afi: ipv4
              safi: multicast
              inherit:
                template: BasePolicy
                sequence: 200
      vrfs:
        - vrf: site-1
          neighbors:
            - neighbor_address: 203.0.113.1
              address_family:
                - afi: ipv4
                  safi: unicast
            - neighbor_address: 203.0.113.2
              address_family:
                - afi: ipv6
                  safi: unicast
                - afi: ipv4
                  safi: multicast
                  send_community:
                    set: true
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  before:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            maximum_prefix:
#              max_prefix_limit: 20
#              generate_warning_threshold: 75
#            weight: 100
#            prefix_list:
#              inbound: rmap1
#              outbound: rmap2
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast
#
#  commands:
#    - router bgp 65536
#    - neighbor 192.0.2.32
#    - address-family ipv4 unicast
#    - no maximum-prefix 20 75
#    - weight 110
#    - no prefix-list rmap1 in
#    - no prefix-list rmap2 out
#    - vrf site-1
#    - neighbor 203.0.113.1
#    - address-family ipv4 unicast
#    - no suppress-inactive
#    - no next-hop-self
#
#  after:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            weight: 110
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast

# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       weight 110
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

# Using overridden

# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

- name: Override all BGP AF configuration with provided configuration
  cisco.nxos.nxos_bgp_neighbor_address_family:
    config:
      as_number: 65536
      neighbors:
        - neighbor_address: 192.0.2.32
          address_family:
            - afi: ipv4
              safi: unicast
      vrfs:
        - vrf: site-1
          neighbors:
            - neighbor_address: 203.0.113.1
              address_family:
                - afi: ipv4
                  safi: unicast
                  suppress_inactive: true
                  next_hop_self:
                    set: true
    state: overridden
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  before:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            maximum_prefix:
#              max_prefix_limit: 20
#              generate_warning_threshold: 75
#            weight: 100
#            prefix_list:
#              inbound: rmap1
#              outbound: rmap2
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast
#
#  commands:
#    - router bgp 65536
#    - neighbor 192.0.2.32
#    - address-family ipv4 unicast
#    - no maximum-prefix 20 75
#    - no weight 100
#    - no prefix-list rmap1 in
#    - no prefix-list rmap2 out
#    - no address-family ipv6 unicast
#    - neighbor 192.0.2.33
#    - no address-family ipv4 multicast
#    - vrf site-1
#    - neighbor 203.0.113.2
#    - no address-family ipv4 multicast
#    - no address-family ipv6 unicast
#
#  after:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true

# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self

# Using deleted to remove specified neighbor AFs

# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

- name: Delete BGP configs handled by this module
  cisco.nxos.nxos_bgp_neighbor_address_family:
    config:
      as_number: 65536
      neighbors:
        - neighbor_address: 192.0.2.32
          address_family:
            - afi: ipv4
              safi: unicast
      vrfs:
        - vrf: site-1
          neighbors:
            - neighbor_address: 203.0.113.2
              address_family:
                - afi: ipv6
                  safi: unicast
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  before:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            maximum_prefix:
#              max_prefix_limit: 20
#              generate_warning_threshold: 75
#            weight: 100
#            prefix_list:
#              inbound: rmap1
#              outbound: rmap2
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast
#
#  commands:
#    - router bgp 65536
#    - neighbor 192.0.2.32
#    - no address-family ipv4 unicast
#    - vrf site-1
#    - neighbor 203.0.113.2
#    - no address-family ipv6 unicast
#
#  after:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#

# Using deleted to remove all neighbor AFs

# Before state:
# -------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast
#

- name: Delete all BGP neighbor AF configs handled by this module
  cisco.nxos.nxos_bgp_neighbor_address_family:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  before:
#    as_number: "65536"
#    neighbors:
#      - neighbor_address: 192.0.2.32
#        address_family:
#          - afi: ipv4
#            safi: unicast
#            maximum_prefix:
#              max_prefix_limit: 20
#              generate_warning_threshold: 75
#            weight: 100
#            prefix_list:
#              inbound: rmap1
#              outbound: rmap2
#          - afi: ipv6
#            safi: unicast
#      - neighbor_address: 192.0.2.33
#        address_family:
#          - afi: ipv4
#            safi: multicast
#            inherit:
#              template: BasePolicy
#              sequence: 200
#    vrfs:
#      - vrf: site-1
#        neighbors:
#          - neighbor_address: 203.0.113.1
#            address_family:
#              - afi: ipv4
#                safi: unicast
#                suppress_inactive: true
#                next_hop_self:
#                  set: true
#          - neighbor_address: 203.0.113.2
#            address_family:
#              - afi: ipv4
#                safi: multicast
#                send_community:
#                  set: true
#              - afi: ipv6
#                safi: unicast
#
#  commands:
#    - router bgp 65536
#    - neighbor 192.0.2.32
#    - no address-family ipv4 unicast
#    - no address-family ipv6 unicast
#    - neighbor 192.0.2.33
#    - no address-family ipv4 multicast
#    - vrf site-1
#    - neighbor 203.0.113.1
#    - no address-family ipv4 unicast
#    - neighbor 203.0.113.2
#    - no address-family ipv6 unicast
#    - no address-family ipv4 multicast
#
#  after:
#    as_number: "65536"
#
# After state:
# ------------
# Nexus9000v# show running-config | section "^router bgp"
# router bgp 65536
#   neighbor 192.0.2.32
#   neighbor 192.0.2.33
#   vrf site-1
#     neighbor 203.0.113.1
#     neighbor 203.0.113.2
#

# Using rendered

- name: Render platform specific configuration lines with state rendered (without connecting to the device)
  cisco.nxos.nxos_bgp_neighbor_address_family:
    config:
      as_number: 65536
      neighbors:
        - neighbor_address: 192.0.2.32
          address_family:
            - afi: ipv4
              safi: unicast
              maximum_prefix:
                max_prefix_limit: 20
                generate_warning_threshold: 75
              weight: 100
              prefix_list:
                inbound: rmap1
                outbound: rmap2
            - afi: ipv6
              safi: unicast
        - neighbor_address: 192.0.2.33
          address_family:
            - afi: ipv4
              safi: multicast
              inherit:
                template: BasePolicy
                sequence: 200
      vrfs:
        - vrf: site-1
          neighbors:
            - neighbor_address: 203.0.113.1
              address_family:
                - afi: ipv4
                  safi: unicast
                  suppress_inactive: true
                  next_hop_self:
                    set: true
            - neighbor_address: 203.0.113.2
              address_family:
                - afi: ipv6
                  safi: unicast
                - afi: ipv4
                  safi: multicast
                  send_community:
                    set: true
    state: rendered
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Task output:
# ------------
#  rendered:
#    - router bgp 65536
#    - neighbor 192.0.2.32
#    - address-family ipv4 unicast
#    - maximum-prefix 20 75
#    - weight 100
#    - prefix-list rmap1 in
#    - prefix-list rmap2 out
#    - address-family ipv6 unicast
#    - neighbor 192.0.2.33
#    - address-family ipv4 multicast
#    - inherit peer-policy BasePolicy 200
#    - vrf site-1
#    - neighbor 203.0.113.1
#    - address-family ipv4 unicast
#    - suppress-inactive
#    - next-hop-self
#    - neighbor 203.0.113.2
#    - address-family ipv6 unicast
#    - address-family ipv4 multicast
#    - send-community

# Using parsed

# parsed.cfg
# ------------
# router bgp 65536
#   neighbor 192.0.2.32
#     address-family ipv4 unicast
#       maximum-prefix 20 75
#       weight 100
#       prefix-list rmap1 in
#       prefix-list rmap2 out
#     address-family ipv6 unicast
#   neighbor 192.0.2.33
#     address-family ipv4 multicast
#       inherit peer-policy BasePolicy 200
#   vrf site-1
#     neighbor 203.0.113.1
#       address-family ipv4 unicast
#         suppress-inactive
#         next-hop-self
#     neighbor 203.0.113.2
#       address-family ipv4 multicast
#         send-community
#       address-family ipv6 unicast

- name: Parse externally provided BGP neighbor AF config
  register: result
  cisco.nxos.nxos_bgp_neighbor_address_family:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    - parsed
    - gathered
    - rendered
    default: merged
    description:
    - The state the configuration should be left in.
    - State I(deleted) only removes BGP attributes that this modules manages and does
      not negate the BGP process completely.
    - Refer to examples for more details.
    type: str

config:
    description: BGP Neighbor AF configuration.
    suboptions:
      as_number:
        description: Autonomous System Number of the router.
        type: str
      neighbors:
        description: A list of BGP Neighbor AF configuration.
        elements: dict
        suboptions:
          address_family:
            description: BGP Neighbor Address Family related configurations.
            elements: dict
            suboptions:
              advertise_map:
                description: Specify route-map for conditional advertisement.
                suboptions:
                  exist_map:
                    description: Condition route-map to advertise only when prefix in
                      condition exists.
                    type: str
                  non_exist_map:
                    description: Condition route-map to advertise only when prefix in
                      condition does not exist.
                    type: str
                  route_map:
                    description: Route-map name.
                    required: true
                    type: str
                type: dict
              advertisement_interval:
                description: Minimum interval between sending BGP routing updates.
                type: int
              afi:
                choices:
                - ipv4
                - ipv6
                - link-state
                - vpnv4
                - vpnv6
                - l2vpn
                description: Address Family indicator.
                required: true
                type: str
              allowas_in:
                description: Accept as-path with my AS present in it.
                suboptions:
                  max_occurences:
                    description: Number of occurrences of AS number, default is 3.
                    type: int
                  set:
                    description: Activate allowas-in property.
                    type: bool
                type: dict
              as_override:
                description: Override matching AS-number while sending update.
                type: bool
              capability:
                description: Advertise capability to the peer.
                suboptions:
                  additional_paths:
                    description: Additional paths capability.
                    suboptions:
                      receive:
                        choices:
                        - enable
                        - disable
                        description: Additional paths Receive capability.
                        type: str
                      send:
                        choices:
                        - enable
                        - disable
                        description: Additional paths Send capability.
                        type: str
                    type: dict
                type: dict
              default_originate:
                description: Originate a default toward this peer.
                suboptions:
                  route_map:
                    description: Route-map to specify criteria for originating default.
                    type: str
                  set:
                    description: Set default-originate attribute.
                    type: bool
                type: dict
              disable_peer_as_check:
                description: Disable checking of peer AS-number while advertising.
                type: bool
              filter_list:
                description: Name of filter-list.
                suboptions:
                  inbound:
                    description: Apply policy to incoming routes.
                    type: str
                  outbound:
                    description: Apply policy to outgoing routes.
                    type: str
                type: dict
              inherit:
                description: Inherit a template.
                suboptions:
                  sequence:
                    description: Sequence number.
                    type: int
                  template:
                    description: Template name.
                    type: str
                type: dict
              maximum_prefix:
                description: Maximum number of prefixes from this neighbor.
                suboptions:
                  generate_warning_threshold:
                    description: Threshold percentage at which to generate a warning.
                    type: int
                  max_prefix_limit:
                    description: Maximum prefix limit.
                    type: int
                  restart_interval:
                    description: Restart bgp connection after limit is exceeded.
                    type: int
                  warning_only:
                    description: Only give a warning message when limit is exceeded.
                    type: bool
                type: dict
              next_hop_self:
                description: Set our address as nexthop (non-reflected).
                suboptions:
                  all_routes:
                    description: Set our address as nexthop for all routes.
                    type: bool
                  set:
                    description: Set next-hop-self attribute.
                    type: bool
                type: dict
              next_hop_third_party:
                description: Compute a third-party nexthop if possible.
                type: bool
              prefix_list:
                description: Apply prefix-list.
                suboptions:
                  inbound:
                    description: Apply policy to incoming routes.
                    type: str
                  outbound:
                    description: Apply policy to outgoing routes.
                    type: str
                type: dict
              rewrite_evpn_rt_asn:
                description: Auto generate RTs for EBGP neighbor.
                type: bool
              rewrite_rt_asn:
                description: Auto generate RTs for EBGP neighbor.
                type: bool
              route_map:
                description: Apply route-map to neighbor.
                suboptions:
                  inbound:
                    description: Apply policy to incoming routes.
                    type: str
                  outbound:
                    description: Apply policy to outgoing routes.
                    type: str
                type: dict
              route_reflector_client:
                description: Configure a neighbor as Route reflector client.
                type: bool
              safi:
                choices:
                - unicast
                - multicast
                - mvpn
                - evpn
                description: Sub Address Family indicator.
                type: str
              send_community:
                description: Send Community attribute to this neighbor.
                suboptions:
                  both:
                    description: Send Standard and Extended Community attributes.
                    type: bool
                  extended:
                    description: Send Extended Community attribute.
                    type: bool
                  set:
                    description: Set send-community attribute.
                    type: bool
                  standard:
                    description: Send Standard Community attribute.
                    type: bool
                type: dict
              soft_reconfiguration_inbound:
                description: Soft reconfiguration.
                suboptions:
                  always:
                    description: Always perform inbound soft reconfiguration.
                    type: bool
                  set:
                    description: Set soft-reconfiguration inbound attribute.
                    type: bool
                type: dict
              soo:
                description: Specify Site-of-origin extcommunity.
                type: str
              suppress_inactive:
                description: Advertise only active routes to peer.
                type: bool
              unsuppress_map:
                description: Route-map to selectively unsuppress suppressed routes.
                type: str
              weight:
                description: Set default weight for routes from this neighbor.
                type: int
            type: list
          neighbor_address:
            description: IP/IPv6 address of the neighbor.
            required: true
            type: str
        type: list
      vrfs:
        description: Virtual Router Context.
        elements: dict
        suboptions:
          neighbors:
            description: A list of BGP Neighbor AF configuration.
            elements: dict
            suboptions:
              address_family:
                description: BGP Neighbor Address Family related configurations.
                elements: dict
                suboptions:
                  advertise_map:
                    description: Specify route-map for conditional advertisement.
                    suboptions:
                      exist_map:
                        description: Condition route-map to advertise only when prefix
                          in condition exists.
                        type: str
                      non_exist_map:
                        description: Condition route-map to advertise only when prefix
                          in condition does not exist.
                        type: str
                      route_map:
                        description: Route-map name.
                        required: true
                        type: str
                    type: dict
                  advertisement_interval:
                    description: Minimum interval between sending BGP routing updates.
                    type: int
                  afi:
                    choices:
                    - ipv4
                    - ipv6
                    - link-state
                    - vpnv4
                    - vpnv6
                    - l2vpn
                    description: Address Family indicator.
                    required: true
                    type: str
                  allowas_in:
                    description: Accept as-path with my AS present in it.
                    suboptions:
                      max_occurences:
                        description: Number of occurrences of AS number, default is 3.
                        type: int
                      set:
                        description: Activate allowas-in property.
                        type: bool
                    type: dict
                  as_override:
                    description: Override matching AS-number while sending update.
                    type: bool
                  capability:
                    description: Advertise capability to the peer.
                    suboptions:
                      additional_paths:
                        description: Additional paths capability.
                        suboptions:
                          receive:
                            choices:
                            - enable
                            - disable
                            description: Additional paths Receive capability.
                            type: str
                          send:
                            choices:
                            - enable
                            - disable
                            description: Additional paths Send capability.
                            type: str
                        type: dict
                    type: dict
                  default_originate:
                    description: Originate a default toward this peer.
                    suboptions:
                      route_map:
                        description: Route-map to specify criteria for originating default.
                        type: str
                      set:
                        description: Set default-originate attribute.
                        type: bool
                    type: dict
                  disable_peer_as_check:
                    description: Disable checking of peer AS-number while advertising.
                    type: bool
                  filter_list:
                    description: Name of filter-list.
                    suboptions:
                      inbound:
                        description: Apply policy to incoming routes.
                        type: str
                      outbound:
                        description: Apply policy to outgoing routes.
                        type: str
                    type: dict
                  inherit:
                    description: Inherit a template.
                    suboptions:
                      sequence:
                        description: Sequence number.
                        type: int
                      template:
                        description: Template name.
                        type: str
                    type: dict
                  maximum_prefix:
                    description: Maximum number of prefixes from this neighbor.
                    suboptions:
                      generate_warning_threshold:
                        description: Threshold percentage at which to generate a warning.
                        type: int
                      max_prefix_limit:
                        description: Maximum prefix limit.
                        type: int
                      restart_interval:
                        description: Restart bgp connection after limit is exceeded.
                        type: int
                      warning_only:
                        description: Only give a warning message when limit is exceeded.
                        type: bool
                    type: dict
                  next_hop_self:
                    description: Set our address as nexthop (non-reflected).
                    suboptions:
                      all_routes:
                        description: Set our address as nexthop for all routes.
                        type: bool
                      set:
                        description: Set next-hop-self attribute.
                        type: bool
                    type: dict
                  next_hop_third_party:
                    description: Compute a third-party nexthop if possible.
                    type: bool
                  prefix_list:
                    description: Apply prefix-list.
                    suboptions:
                      inbound:
                        description: Apply policy to incoming routes.
                        type: str
                      outbound:
                        description: Apply policy to outgoing routes.
                        type: str
                    type: dict
                  rewrite_evpn_rt_asn:
                    description: Auto generate RTs for EBGP neighbor.
                    type: bool
                  rewrite_rt_asn:
                    description: Auto generate RTs for EBGP neighbor.
                    type: bool
                  route_map:
                    description: Apply route-map to neighbor.
                    suboptions:
                      inbound:
                        description: Apply policy to incoming routes.
                        type: str
                      outbound:
                        description: Apply policy to outgoing routes.
                        type: str
                    type: dict
                  route_reflector_client:
                    description: Configure a neighbor as Route reflector client.
                    type: bool
                  safi:
                    choices:
                    - unicast
                    - multicast
                    - mvpn
                    - evpn
                    description: Sub Address Family indicator.
                    type: str
                  send_community:
                    description: Send Community attribute to this neighbor.
                    suboptions:
                      both:
                        description: Send Standard and Extended Community attributes.
                        type: bool
                      extended:
                        description: Send Extended Community attribute.
                        type: bool
                      set:
                        description: Set send-community attribute.
                        type: bool
                      standard:
                        description: Send Standard Community attribute.
                        type: bool
                    type: dict
                  soft_reconfiguration_inbound:
                    description: Soft reconfiguration.
                    suboptions:
                      always:
                        description: Always perform inbound soft reconfiguration.
                        type: bool
                      set:
                        description: Set soft-reconfiguration inbound attribute.
                        type: bool
                    type: dict
                  soo:
                    description: Specify Site-of-origin extcommunity.
                    type: str
                  suppress_inactive:
                    description: Advertise only active routes to peer.
                    type: bool
                  unsuppress_map:
                    description: Route-map to selectively unsuppress suppressed routes.
                    type: str
                  weight:
                    description: Set default weight for routes from this neighbor.
                    type: int
                type: list
              neighbor_address:
                description: IP/IPv6 address of the neighbor.
                required: true
                type: str
            type: list
          vrf:
            description: VRF name.
            type: str
        type: list
    type: dict

running_config:
    description:
    - This option is used only with state I(parsed).
    - The value of this option should be the output received from the NX-OS device by
      executing the command B(show running-config | section '^router bgp').
    - The state I(parsed) reads the configuration from C(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 I(parsed) key within the result.
    type: str

Outputs

after:
  description: The resulting configuration after module execution.
  returned: when changed
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
before:
  description: The configuration prior to the module execution.
  returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or
    C(purged)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
commands:
  description: The set of commands pushed to the remote device.
  returned: when I(state) is C(merged), C(replaced), C(overridden), C(deleted) or
    C(purged)
  sample:
  - router bgp 65536
  - neighbor 192.0.2.32
  - address-family ipv4 unicast
  type: list
gathered:
  description: Facts about the network resource gathered from the remote device as
    structured data.
  returned: when I(state) is C(gathered)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
parsed:
  description: The device native config provided in I(running_config) option parsed
    into structured data as per module argspec.
  returned: when I(state) is C(parsed)
  sample: 'This output will always be in the same format as the module argspec.

    '
  type: dict
rendered:
  description: The provided configuration in the task rendered in device-native format
    (offline).
  returned: when I(state) is C(rendered)
  sample:
  - router bgp 65536
  - neighbor 192.0.2.32
  - address-family ipv4 unicast
  type: list