alliedtelesis.awplus.awplus_bgp (1.2.2) — module

Manages Border Gateway Protocol (BGP) configuration of AlliedWare Plus devices

| "added in version" 2.10.4 of alliedtelesis.awplus"

Authors: Darryl Alang

preview | supported by network

Install collection

Install with ansible-galaxy collection install alliedtelesis.awplus:==1.2.2


Add to requirements.yml

  collections:
    - name: alliedtelesis.awplus
      version: 1.2.2

Description

This module manages Border Gateway Protocol (BGP) attributes of AlliedWare Plus devices.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using merged
#
# Before state:
# -------------
# aw1#show running-config bgp
# !
# router bgp 100
#  !
#  address-family ipv4 vrf red
#  exit-address-family
# !

- name: Configure a simple ASN
  alliedtelesis.awplus.awplus_bgp:
    config:
      bgp_as: 100
      log_neighbor_changes: true
      router_id: 192.0.2.4
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
# aw1#show running-config bgp
# !
# router bgp 100
#  bgp router-id 192.0.2.4
#  bgp log-neighbor-changes
#  !
#  address-family ipv4 vrf red
#  exit-address-family
# !


# Using replaced
#
# Before state:
# -------------
# aw1#show running-config bgp
# !
# router bgp 100
#  !
#  address-family ipv4 vrf red
#  exit-address-family
# !

- name: Replace device configuration with provided configuration
  alliedtelesis.awplus.awplus_bgp:
    config:
      bgp_as: 100
      log_neighbor_changes: true
      router_id: 192.0.2.4
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
# aw1#show running-config bgp
# !
# router bgp 100
#  bgp router-id 12.3.4.5
#  bgp log-neighbor-changes
# !


# Using deleted
#
# Before state:
# -------------
# aw1#show running-config bgp
# !
# router bgp 100
#  !
#  address-family ipv4 vrf red
#  exit-address-family
# !

- name: Delete LLDP attributes of given interfaces
  alliedtelesis.awplus.awplus_bgp:
    state: deleted

Inputs

    
state:
    choices:
    - merged
    - replaced
    - deleted
    default: merged
    description:
    - The state the configuration should be left in
    type: str

config:
    description: The provided configuration.
    suboptions:
      address_family:
        description:
        - Specifies BGP address family related configurations.
        elements: dict
        suboptions:
          neighbors:
            description:
            - Specifies BGP neighbor related configurations in Address Family configuration
              mode.
            elements: dict
            suboptions:
              activate:
                description:
                - Enable the Address Family for this neighbor.
                type: bool
              maximum_prefix:
                description:
                - Maximum number of prefix limit to accept from this peer.
                - The range is from 1 to 4294967295.
                type: int
              neighbor:
                description:
                - Neighbor router address. Can either be an IPv4 or IPv6 address or a
                  neighbor tag.
                required: true
                type: str
              next_hop_self:
                description:
                - Enable/disable the next hop calculation for this neighbor.
                type: bool
              prefix_list_in:
                description:
                - Specifies that the IP prefix list applies to incoming advertisements.
                type: str
              prefix_list_out:
                description:
                - Specifies that the IP prefix list applies to outgoing advertisements.
                type: str
              remote_as:
                description:
                - Remote AS of the BGP neighbor to configure.
                required: true
                type: int
              remove_private_as:
                description:
                - Remove the private AS number from outbound updates.
                type: bool
            type: list
          networks:
            description:
            - Specify Networks to announce via BGP.
            elements: dict
            suboptions:
              backdoor:
                description:
                - Specifies a BGP backdoor route.
                type: bool
              masklen:
                description:
                - Subnet mask length for the Network to announce.
                type: int
              prefix:
                description:
                - Network ID to announce via BGP.
                required: true
                type: str
              route_map:
                description:
                - Route map to modify the attributes.
                type: str
            type: list
          redistribute:
            description:
            - Specifies the redistribute information from another routing protocol.
            elements: dict
            suboptions:
              protocol:
                choices:
                - connected
                - isis
                - ospf
                - rip
                - static
                description:
                - Specifies the protocol for configuring redistribute information.
                required: true
                type: str
              route_map:
                description:
                - Specifies the route map reference.
                type: str
            type: list
          vrf:
            description:
            - The name of the VRF instance.
            required: true
            type: str
        type: list
      bgp_as:
        description: Specifies the 32-bit Autonomous System (AS) number.
        required: true
        type: int
      log_neighbor_changes:
        description:
        - Enable/disable logging neighbor up/down and reset reason.
        type: bool
      neighbors:
        description:
        - Specifies BGP neighbor related configurations.
        elements: dict
        suboptions:
          description:
            description:
            - Neighbor specific description.
            type: str
          ebgp_multihop:
            description:
            - Specifies the maximum hop count for EBGP neighbors not on directly connected
              networks.
            - The range is from 1 to 255.
            type: int
          enabled:
            description:
            - Administratively shutdown or enable a neighbor.
            type: bool
          local_as:
            description:
            - Specifies the AS number to use with BGP neighbor.
            type: int
          neighbor:
            description:
            - Neighbor router address. Can either be an IPv4 or IPv6 address or a neighbor
              tag.
            required: true
            type: str
          password:
            description:
            - Password to authenticate the BGP peer connection.
            type: str
          peer_group:
            description:
            - Adds a BGP neighbor to an existing peer group.
            type: str
          remote_as:
            description:
            - Remote AS of the BGP neighbor to configure.
            required: true
            type: int
          timers:
            description:
            - Specifies BGP neighbor timer related configurations.
            suboptions:
              connect:
                description:
                - Specifies the connect timer in seconds.
                - The range is from 1 to 65535.
                type: int
              holdtime:
                description:
                - Interval (in seconds) after which, on not receiving a keepalive message,
                  the router declares a neighbor dead.
                - The range is from 0 to 65535.
                type: int
              keepalive:
                description:
                - Frequency (in seconds) at which a router sends keepalive messages to
                  its neighbor. to its peer.
                - The range is from 0 to 65535.
                type: int
            type: dict
          update_source:
            description:
            - Source of the routing updates.
            type: str
        type: list
      networks:
        description:
        - Specify Networks to announce via BGP.
        - For operation replace, this option is mutually exclusive with networks option
          under address_family.
        - For operation replace, if the device already has an address family activated,
          this option is not allowed.
        elements: dict
        suboptions:
          backdoor:
            description:
            - Specifies a BGP backdoor route.
            type: bool
          masklen:
            default: 32
            description:
            - Subnet mask length for the Network to announce.
            type: int
          prefix:
            description:
            - Network ID to announce via BGP.
            required: true
            type: str
          route_map:
            description:
            - Route map to modify the attributes.
            type: str
        type: list
      router_id:
        description: Router Identifier (ID) of the BGP router VRF instance in IP format.
        type: str
    type: dict

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - router bgp 100
  - bgp router-id 192.0.2.4
  type: list