dellemc.enterprise_sonic.sonic_bgp_ext_communities (2.4.0) — module

Manage BGP extended community-list and its parameters

| "added in version" 1.0.0 of dellemc.enterprise_sonic"

Authors: Kumaraguru Narayanan (@nkumaraguru)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install dellemc.enterprise_sonic:==2.4.0


Add to requirements.yml

  collections:
    - name: dellemc.enterprise_sonic
      version: 2.4.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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

Inputs

    
state:
    choices:
    - merged
    - deleted
    - replaced
    - overridden
    default: merged
    description:
    - The state of the configuration after module completion.
    type: str

config:
    description: A list of 'bgp_extcommunity_list' configurations.
    elements: dict
    suboptions:
      match:
        choices:
        - all
        - any
        default: any
        description:
        - Matches any/all of the the members.
        required: false
        type: str
      members:
        description:
        - Members of this BGP ext community list.
        required: false
        suboptions:
          regex:
            description:
            - Members of this BGP ext community list. Regular expression string can be
              given here. Applicable for expanded ext BGP community type.
            elements: str
            required: false
            type: list
          route_origin:
            description:
            - 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.
            elements: str
            required: false
            type: list
          route_target:
            description:
            - 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.
            elements: str
            required: false
            type: list
        type: dict
      name:
        description:
        - Name of the BGP ext communitylist.
        required: true
        type: str
      permit:
        description:
        - Permits or denies this community.
        - Default value while adding a new ext-community-list is False.
        required: false
        type: bool
      type:
        choices:
        - standard
        - expanded
        default: standard
        description:
        - Whether it is a standard or expanded ext community_list entry.
        required: false
        type: str
    type: list

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: 'The configuration returned will always be in the same format of the parameters
    above.

    '
  type: list
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: 'The configuration returned will always be in the same format of the parameters
    above.

    '
  type: list
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - command 1
  - command 2
  - command 3
  type: list