W3cubDocs

/Ansible

dellemc.enterprise_sonic.sonic_bgp_neighbors_af – Manage the BGP neighbor address-family and its parameters

Note

This plugin is part of the dellemc.enterprise_sonic collection (version 1.1.0).

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 dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_bgp_neighbors_af.

New in version 1.0.0: of dellemc.enterprise_sonic

Synopsis

  • This module provides configuration management of BGP neighbors address-family parameters on devices running Enterprise SONiC.
  • bgp_as, vrf_name and neighbors need be created in advance on the device.

Note

This module has a corresponding action plugin.

Parameters

Parameter Choices/Defaults Comments
config
list / elements=dictionary
Specifies the BGP neighbors address-family related configuration.
bgp_as
string / required
Specifies the BGP autonomous system (AS) number which is already configured on the device.
neighbors
list / elements=dictionary
Specifies BGP neighbor related configurations in address-family configuration mode.
address_family
list / elements=dictionary
Specifies BGP address-family related configurations.
afi and safi are required together.
activate
boolean
    Choices:
  • no
  • yes
Enables the address-family for this neighbor.
afi
string / required
    Choices:
  • ipv4
  • ipv6
  • l2vpn
Type of address-family to configure.
allowas_in
dictionary
Specifies the allowas in values.
origin
boolean
    Choices:
  • no
  • yes
Specifies the origin value.
value
integer
Specifies the value of the allowas in.
route_map
list / elements=dictionary
Specifies the route-map.
direction
string
Specifies the direction of the route-map.
name
string
Specifies the name of the route-map.
route_reflector_client
boolean
    Choices:
  • no
  • yes
Specifies a neighbor as a route-reflector client.
route_server_client
boolean
    Choices:
  • no
  • yes
Specifies a neighbor as a route-server client.
safi
string
    Choices:
  • unicast
  • evpn
Specifies the type of cast for the address-family.
neighbor
string / required
Neighbor router address which is already configured on the device.
vrf_name
string
Default:
"default"
Specifies the VRF name which is already configured on the device.
state
string
    Choices:
  • merged
  • deleted
Specifies the operation to be performed on the BGP process that is configured on the device.
In case of merged, the input configuration is merged with the existing BGP configuration on the device.
In case of deleted, the existing BGP configuration is removed from the device.

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.
  • Supports check_mode.

Examples

# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#  !
#  address-family ipv4 unicast
#   activate
#   allowas-in 4
#   route-map aa in
#   route-map aa out
#   route-reflector-client
#   route-server-client
#   send-community both
#!
#
- name: Deletes neighbors address-family with specific values
  dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
     config:
       - bgp_as: 4
         neighbors:
           - neighbor: Eth1/3
             address_family:
               - afi: ipv4
                 safi: unicast
                 allowas_in:
                   value: 4
                 route_map:
                   - name: aa
                     direction: in
                   - name: aa
                     direction: out
                 route_reflector_client: true
                 route_server_client: true
     state: deleted

# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#  !
#  address-family ipv4 unicast
#   send-community both
#!


# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#  !
#  address-family ipv4 unicast
#   activate
#   allowas-in 4
#   route-map aa in
#   route-map aa out
#   route-reflector-client
#   route-server-client
#   send-community both
#!
# neighbor interface Eth1/5
#  !
#  address-family ipv4 unicast
#   activate
#   allowas-in origin
#   send-community both
#!
#
- name: Deletes neighbors address-family with specific values
  dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
     config:
     state: deleted

# After state:
# ------------
#!
#router bgp 4
#!


# Using deleted
#
# Before state:
# -------------
#
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#!
#
- name: Merges neighbors address-family with specific values
  dellemc.enterprise_sonic.sonic_bgp_neighbors_af:
     config:
       - bgp_as: 4
         neighbors:
           - neighbor: Eth1/3
             address_family:
               - afi: ipv4
                 safi: unicast
                 allowas_in:
                   value: 4
                 route_map:
                   - name: aa
                     direction: in
                   - name: aa
                     direction: out
                 route_reflector_client: true
                 route_server_client: true
     state: merged

# After state:
# ------------
#!
#router bgp 4
# !
# neighbor interface Eth1/3
#  !
#  address-family ipv4 unicast
#   activate
#   allowas-in 4
#   route-map aa in
#   route-map aa out
#   route-reflector-client
#   route-server-client
#   send-community both
#!

Return Values

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

Key Returned Description
after
list / elements=string
when changed
The resulting configuration model invocation.

Sample:
The configuration returned is always in the same format of the parameters above.
before
list / elements=string
always
The configuration prior to the model invocation.

Sample:
The configuration returned is always in the same format of the parameters above.
commands
list / elements=string
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Authors

  • Niraimadaiselvam M (@niraimadaiselvamm)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/dellemc/enterprise_sonic/sonic_bgp_neighbors_af_module.html