dellemc.enterprise_sonic.sonic_bgp_communities (2.4.0) — module

Manage BGP community 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 bgp_communities for device 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 community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Delete a BGP community-list member
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test1
        type: expanded
        permit: false
        members:
          regex:
          - 302
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101


# Using deleted

# Before state:
# -------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Delete a single BGP community-list
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test
        type: standard
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302


# Using deleted

# Before state:
# -------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Delete All BGP community-lists
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
#


# Using deleted

# Before state:
# -------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Delete all members in a single BGP community-list
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test1
        type: expanded
        members:
          regex:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer


# Using merged

# Before state:
# -------------
#
# show bgp community-list
# Expanded community list test1:   match: ANY
#     permit 101
#     permit 302

- name: Add a new BGP community-list
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test2
        type: expanded
        permit: true
        members:
          regex:
          - 909
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
# Expanded community list test1:   match: ANY
#     permit 101
#     permit 302
# Expanded community list test2:   match: ANY
#     permit 909


# Using replaced

# Before state:
# -------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Replacing a single BGP community-list
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test
        type: expanded
        members:
          regex:
          - 301
      - name: test3
        type: standard
        no_advertise: true
        no_peer: true
        permit: false
        match: ALL
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#
# show bgp community-list
# Expanded community list test:   match: ANY
#     deny 301
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302
# Standard community list test3:  match: ALL
#     deny no-advertise
#     deny no-peer


# Using overridden

# Before state:
# -------------
#
# show bgp community-list
# Standard community list test:  match: ANY
#     permit local-as
#     permit no-peer
# Expanded community list test1:   match: ANY
#     deny 101
#     deny 302

- name: Override entire BGP community-lists
  dellemc.enterprise_sonic.sonic_bgp_communities:
    config:
      - name: test3
        type: expanded
        members:
          regex:
          - 301
    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_communities' configurations.
    elements: dict
    suboptions:
      aann:
        description:
        - Community number aa:nn format 0..65535:0..65535; applicable for standard BGP
          community type.
        required: false
        type: str
      local_as:
        description:
        - Do not send outside local AS (well-known community); applicable for standard
          BGP community type.
        required: false
        type: bool
      match:
        choices:
        - ALL
        - ANY
        default: ANY
        description:
        - Matches any/all of the members.
        required: false
        type: str
      members:
        description:
        - Members of this BGP community list.
        required: false
        suboptions:
          regex:
            description:
            - Members of this BGP community list. Regular expression string can be given
              here. Applicable for expanded BGP community type.
            elements: str
            required: false
            type: list
        type: dict
      name:
        description:
        - Name of the BGP community-list.
        required: true
        type: str
      no_advertise:
        description:
        - Do not advertise to any peer (well-known community); applicable for standard
          BGP community type.
        required: false
        type: bool
      no_export:
        description:
        - Do not export to next AS (well-known community); applicable for standard BGP
          community type.
        required: false
        type: bool
      no_peer:
        description:
        - Do not export to next AS (well-known community); applicable for standard BGP
          community type.
        required: false
        type: bool
      permit:
        description:
        - Permits or denies this community.
        - Default value while adding a new community-list is C(False).
        required: false
        type: bool
      type:
        choices:
        - standard
        - expanded
        default: standard
        description:
        - Whether it is a standard or expanded community-list entry.
        required: false
        type: str
    type: list

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: "The configuration that is returned is always in the same format\n of the\
    \ parameters above.\n"
  type: list
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: "The configuration that is returned is always in the same format\n of the\
    \ parameters above.\n"
  type: list
commands:
  description: The set of commands that are pushed to the remote device.
  returned: always
  sample:
  - command 1
  - command 2
  - command 3
  type: list