New in version 2.2.
Manages BGP neighbors configurations on NX-OS switches.
parameter | required | default | choices | comments |
---|---|---|---|---|
asn | yes | BGP autonomous system number. Valid values are string, Integer in ASPLAIN or ASDOT notation. |
||
capability_negotiation | no |
| Configure whether or not to negotiate capability with this neighbor. |
|
connected_check | no |
| Configure whether or not to check for directly connected peer. |
|
description | no | Description of the neighbor. |
||
dynamic_capability | no |
| 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 |
| Specify whether or not to enable log messages for neighbor up/down event. |
|
low_memory_exempt | no |
| 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 |
| 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 |
| 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 |
| 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 |
| Determines whether the config should be present or not on the device. |
suppress_4_byte_as | no |
| Configure to suppress 4-byte AS Capability. |
|
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 |
| 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 |
| 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. The value of username 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. |
||
vrf | no | default | Name of the VRF. The name 'default' is a valid VRF representing the global bgp. |
# 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 }}"
Common return values are documented here Common Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
end_state | k/v pairs of BGP neighbor configuration after module execution | verbose mode | dict | {'update_source': 'Ethernet1/3', 'maximum_peers': '', 'timers_holdtime': '180', 'local_as': '20', 'pwd_type': '', 'timers_keepalive': '60', 'dynamic_capability': True, 'vrf': 'default', 'shutdown': False, 'low_memory_exempt': False, 'log_neighbor_changes': '', 'remove_private_as': 'disable', 'suppress_4_byte_as': False, 'connected_check': False, 'remote_as': '30', 'ebgp_multihop': '', 'description': 'just a description', 'pwd': '', 'asn': '65535', 'transport_passive_only': False, 'capability_negotiation': False, 'neighbor': '3.3.3.3'} |
changed | check to see if a change was made on the device | always | boolean | True |
updates | 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'] |
proposed | k/v pairs of parameters passed into module | verbose mode | dict | {'update_source': 'Ethernet1/3', 'remote_as': '30', 'shutdown': 'default', 'local_as': '20', 'vrf': 'default', 'neighbor': '3.3.3.3', 'asn': '65535', 'description': 'just a description'} |
existing | k/v pairs of existing BGP neighbor configuration | verbose mode | dict | {} |
Note
state=absent
removes the whole BGP neighbor configuration.
Note
Default, where supported, restores params default value.
For more information on what this means please read Core Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.
© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/nxos_bgp_neighbor_module.html