nxos_bgp_neighbor - Manages BGP neighbors configurations.

New in version 2.2.

Synopsis

  • Manages BGP neighbors configurations on NX-OS switches.

Options

parameter required default choices comments
asn
yes
BGP autonomous system number. Valid values are string, Integer in ASPLAIN or ASDOT notation.
auth_pass
(added in 2.4.4)
no none
Specifies the password to use if required to enter privileged mode on the remote device. If authorize is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTH_PASS will be used instead.
authorize
(added in 2.4.4)
no
  • yes
  • no
Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_AUTHORIZE will be used instead.
capability_negotiation
no
  • true
  • false
Configure whether or not to negotiate capability with this neighbor.
connected_check
no
  • true
  • false
Configure whether or not to check for directly connected peer.
description
no
Description of the neighbor.
dynamic_capability
no
  • true
  • false
Configure whether or not to enable dynamic capability.
ebgp_multihop
no
Specify multihop TTL for a remote peer. Valid values are integers between 2 and 255, or keyword 'default' to disable this property.
host
yes
Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.
local_as
no
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.
log_neighbor_changes
no
  • enable
  • disable
  • inherit
Specify whether or not to enable log messages for neighbor up/down event.
low_memory_exempt
no
  • true
  • false
Specify whether or not to shut down this neighbor under memory pressure.
maximum_peers
no
Specify Maximum number of peers for this neighbor prefix Valid values are between 1 and 1000, or 'default', which does not impose the limit.
neighbor
yes
Neighbor Identifier. Valid values are string. Neighbors may use IPv4 or IPv6 notation, with or without prefix length.
password
no
Specifies the password to use to authenticate the connection to the remote device. This is a common argument used for either cli or nxapi transports. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_PASSWORD will be used instead.
port
no 0 (use common port)
Specifies the port to use when building the connection to the remote device. This value applies to either cli or nxapi. The port value will default to the appropriate transport common port if none is provided in the task. (cli=22, http=80, https=443).
provider
no
Convenience method that allows all nxos arguments to be passed as a dict object. All constraints (required, choices, etc) must be met either by individual arguments or values in this dict.
pwd
no
Specify the password for neighbor. Valid value is string.
pwd_type
no
  • 3des
  • cisco_type_7
Specify the encryption type the password will use. Valid values are '3des' or 'cisco_type_7' encryption.
remote_as
no
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.
remove_private_as
no
  • enable
  • disable
  • all
  • replace-as
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.
shutdown
no
  • true
  • false
Configure to administratively shutdown this neighbor.
ssh_keyfile
no
Specifies the SSH key to use to authenticate the connection to the remote device. This argument is only used for the cli transport. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_SSH_KEYFILE will be used instead.
state
no present
  • present
  • absent
Determines whether the config should be present or not on the device.
suppress_4_byte_as
no
  • true
  • false
Configure to suppress 4-byte AS Capability.
timeout
(added in 2.3)
no 10
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. NX-API can be slow to return on long-running commands (sh mac, sh bgp, etc).
timers_holdtime
no
Specify holdtime timer value. Valid values are integers between 0 and 3600 in terms of seconds, or 'default', which is 180.
timers_keepalive
no
Specify keepalive timer value. Valid values are integers between 0 and 3600 in terms of seconds, or 'default', which is 60.
transport
yes cli
Configures the transport connection to use when connecting to the remote device. The transport argument supports connectivity to the device over cli (ssh) or nxapi.
transport_passive_only
no
  • true
  • false
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.
update_source
no
Specify source interface of BGP session and updates.
use_ssl
no
  • yes
  • no
Configures the transport to use SSL if set to true only when the transport=nxapi, otherwise this value is ignored.
username
no
Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate either the CLI login or the nxapi authentication depending on which transport is used. If the value is not specified in the task, the value of environment variable ANSIBLE_NET_USERNAME will be used instead.
validate_certs
no
  • yes
  • no
If no, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. If the transport argument is not nxapi, this value is ignored.
vrf
no default
Name of the VRF. The name 'default' is a valid VRF representing the global bgp.

Examples

# 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
    state: present

Return Values

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

name description returned type sample
commands
commands sent to the device
always list ['router bgp 65535', 'neighbor 3.3.3.3', 'remote-as 30', 'update-source Ethernet1/3', 'description just a description', 'local-as 20']

Notes

Note

  • Tested against NXOSv 7.3.(0)D1(1) on VIRL
  • state=absent removes the whole BGP neighbor configuration.
  • Default, where supported, restores params default value.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance Info

For more information about Red Hat’s this support of this module, please refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/nxos_bgp_neighbor_module.html