dellemc.enterprise_sonic.sonic_bgp_ext_communities module – Manage BGP extended community-list and its parameters

Note

This module is part of the dellemc.enterprise_sonic collection (version 2.5.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 dellemc.enterprise_sonic.

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

New in dellemc.enterprise_sonic 1.0.0

Synopsis

  • This module provides configuration management of BGP extcommunity-list for devices running Enterprise SONiC Distribution by Dell Technologies.

Note

This module has a corresponding action plugin.

Parameters

Parameter

Comments

config

list / elements=dictionary

A list of ‘bgp_extcommunity_list’ configurations.

match

string

Matches any/all of the the members.

Choices:

  • "all"

  • "any" ← (default)

members

dictionary

Members of this BGP ext community list.

regex

list / elements=string

Members of this BGP ext community list. Regular expression string can be given here. Applicable for expanded ext BGP community type.

route_origin

list / elements=string

Members of this BGP ext community list. The format of route_origin is in either 0..65535:0..65535 or A.B.C.D:[1..65535] format.

route_target

list / elements=string

Members of this BGP ext community list. The format of route_target is in either 0..65535:0..65535 or A.B.C.D:[1..65535] format.

name

string / required

Name of the BGP ext communitylist.

permit

boolean

Permits or denies this community.

Default value while adding a new ext-community-list is False.

Choices:

  • false

  • true

type

string

Whether it is a standard or expanded ext community_list entry.

Choices:

  • "standard" ← (default)

  • "expanded"

state

string

The state of the configuration after module completion.

Choices:

  • "merged" ← (default)

  • "deleted"

  • "replaced"

  • "overridden"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using deleted

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201

- name: Deletes a BGP ext community member
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test
        type: standard
        members:
          route_target:
          - 201:201
    state: deleted

# After state:
# ------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#


# Using deleted

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102

- name: Deletes a single BGP extended community
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test1
        members:
    state: deleted

# After state:
# ------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
#


# Using deleted

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102

- name: Deletes all BGP extended communities
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
    state: deleted

# After state:
# ------------
#
# show bgp ext-community-list
#


# Using deleted

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102

- name: Deletes all members in a single BGP extended community
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test1
        members:
          regex:
    state: deleted

# After state:
# ------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
#


# Using merged

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102

- name: Adds new community list
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test3
        type: standard
        match: any
        permit: true
        members:
          route_origin:
            - "301:301"
            - "401:401"
    state: merged

# After state:
# ------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102
# Standard extended community list test3:  match: ANY
#     permit soo:301:301
#     permit soo:401:401



# Using replaced

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102

- name: Replacing a single BGP extended community
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test
        type: expanded
        permit: true
        match: all
        members:
          regex:
          - 301:302
    state: replaced

# After state:
# ------------
#
# show bgp ext-community-list
# Expanded extended community list test:  match: ALL
#     permit 301:302
# Expanded extended community list test1:   match: ALL
#     deny 101:102
#


# Using overridden

# Before state:
# -------------
#
# show bgp ext-community-list
# Standard extended community list test:  match: ANY
#     permit rt:101:101
#     permit rt:201:201
# Expanded extended community list test1:   match: ALL
#     deny 101:102


- name: Override the entire list of BGP extended community
  dellemc.enterprise_sonic.sonic_bgp_ext_communities:
    config:
      - name: test3
        type: expanded
        permit: true
        match: all
        members:
          regex:
          - 301:302
    state: overridden

# After state:
# ------------
#
# show bgp ext-community-list
# Expanded extended community list test3:  match: ALL
#     permit 301:302
#

Return Values

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

Key

Description

after

list / elements=string

The resulting configuration module invocation.

Returned: when changed

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

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

Authors

  • Kumaraguru Narayanan (@nkumaraguru)