ansible.builtin.nxos_bgp_neighbor (v2.3.3.0-1) — module

Manages BGP neighbors configurations.

| "added in version" 2.2 of ansible.builtin"

Authors: Gabriele Gerbino (@GGabriele)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.3.0.post1

Description

Manages BGP neighbors configurations on NX-OS switches.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# create a new neighbor
- nxos_bgp_neighbor:
    asn: 65535
    neighbor: 3.3.3.3
    local_as: 20
    remote_as: 30
    description: "just a description"
    update_source: Ethernet1/3
    shutdown: default
    state: present
    username: "{{ un }}"
    password: "{{ pwd }}"
    host: "{{ inventory_hostname }}"

Inputs

    
asn:
    description:
    - BGP autonomous system number. Valid values are string, Integer in ASPLAIN or ASDOT
      notation.
    required: true

pwd:
    default: null
    description:
    - Specify the password for neighbor. Valid value is string.
    required: false

vrf:
    default: default
    description:
    - Name of the VRF. The name 'default' is a valid VRF representing the global bgp.
    required: false

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Determines whether the config should be present or not on the device.
    required: false

local_as:
    default: null
    description:
    - Specify the local-as number for the eBGP neighbor. Valid values are String or Integer
      in ASPLAIN or ASDOT notation, or 'default', which means not to configure it.
    required: false

neighbor:
    description:
    - Neighbor Identifier. Valid values are string. Neighbors may use IPv4 or IPv6 notation,
      with or without prefix length.
    required: true

pwd_type:
    choices:
    - 3des
    - cisco_type_7
    default: null
    description:
    - Specify the encryption type the password will use. Valid values are '3des' or 'cisco_type_7'
      encryption.
    required: false

shutdown:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Configure to administratively shutdown this neighbor.
    required: false

remote_as:
    default: null
    description:
    - Specify Autonomous System Number of the neighbor. Valid values are String or Integer
      in ASPLAIN or ASDOT notation, or 'default', which means not to configure it.
    required: false

description:
    default: null
    description:
    - Description of the neighbor.
    required: false

ebgp_multihop:
    default: null
    description:
    - Specify multihop TTL for a remote peer. Valid values are integers between 2 and
      255, or keyword 'default' to disable this property.
    required: false

maximum_peers:
    default: null
    description:
    - Specify Maximum number of peers for this neighbor prefix Valid values are between
      1 and 1000, or 'default', which does not impose the limit.
    required: false

update_source:
    default: null
    description:
    - Specify source interface of BGP session and updates.
    required: false

connected_check:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Configure whether or not to check for directly connected peer.
    required: false

timers_holdtime:
    default: null
    description:
    - Specify holdtime timer value. Valid values are integers between 0 and 3600 in terms
      of seconds, or 'default', which is 180.
    required: false

timers_keepalive:
    default: null
    description:
    - Specify keepalive timer value. Valid values are integers between 0 and 3600 in terms
      of seconds, or 'default', which is 60.
    required: false

low_memory_exempt:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Specify whether or not to shut down this neighbor under memory pressure.
    required: false

remove_private_as:
    choices:
    - enable
    - disable
    - all
    - replace-as
    default: null
    description:
    - Specify the config to remove private AS number from outbound updates. Valid values
      are 'enable' to enable this config, 'disable' to disable this config, 'all' to remove
      all private AS number, or 'replace-as', to replace the private AS number.
    required: false

dynamic_capability:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Configure whether or not to enable dynamic capability.
    required: false

suppress_4_byte_as:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Configure to suppress 4-byte AS Capability.
    required: false

log_neighbor_changes:
    choices:
    - enable
    - disable
    - inherit
    default: null
    description:
    - Specify whether or not to enable log messages for neighbor up/down event.
    required: false

capability_negotiation:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Configure whether or not to negotiate capability with this neighbor.
    required: false

transport_passive_only:
    choices:
    - 'true'
    - 'false'
    default: null
    description:
    - Specify whether or not to only allow passive connection setup. Valid values are
      'true', 'false', and 'default', which defaults to 'false'. This property can only
      be configured when the neighbor is in 'ip' address format without prefix length.
      This property and the transport_passive_mode property are mutually exclusive.
    required: false

Outputs

changed:
  description: check to see if a change was made on the device
  returned: always
  sample: true
  type: boolean
end_state:
  description: k/v pairs of BGP neighbor configuration after module execution
  returned: verbose mode
  sample:
    asn: '65535'
    capability_negotiation: false
    connected_check: false
    description: just a description
    dynamic_capability: true
    ebgp_multihop: ''
    local_as: '20'
    log_neighbor_changes: ''
    low_memory_exempt: false
    maximum_peers: ''
    neighbor: 3.3.3.3
    pwd: ''
    pwd_type: ''
    remote_as: '30'
    remove_private_as: disable
    shutdown: false
    suppress_4_byte_as: false
    timers_holdtime: '180'
    timers_keepalive: '60'
    transport_passive_only: false
    update_source: Ethernet1/3
    vrf: default
  type: dict
existing:
  description: k/v pairs of existing BGP neighbor configuration
  returned: verbose mode
  sample: {}
  type: dict
proposed:
  description: k/v pairs of parameters passed into module
  returned: verbose mode
  sample:
    asn: '65535'
    description: just a description
    local_as: '20'
    neighbor: 3.3.3.3
    remote_as: '30'
    shutdown: default
    update_source: Ethernet1/3
    vrf: default
  type: dict
updates:
  description: commands sent to the device
  returned: always
  sample:
  - router bgp 65535
  - neighbor 3.3.3.3
  - remote-as 30
  - update-source Ethernet1/3
  - description just a description
  - local-as 20
  type: list