Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nxos_bgp_neighbor issues #36318

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 13 additions & 12 deletions lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@
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.
not impose the limit. Note that this parameter is accepted
only on neighbors with address/prefix.
required: false
default: null
pwd:
Expand All @@ -118,9 +119,9 @@
pwd_type:
description:
- Specify the encryption type the password will use. Valid values
are '3des' or 'cisco_type_7' encryption.
are '3des' or 'cisco_type_7' encryption or keyword 'default'.
required: false
choices: ['3des', 'cisco_type_7']
choices: ['3des', 'cisco_type_7', 'default']
default: null
remote_as:
description:
Expand Down Expand Up @@ -170,8 +171,6 @@
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
choices: ['true','false']
default: null
Expand Down Expand Up @@ -388,11 +387,13 @@ def state_present(module, existing, proposed, candidate):
command = '{0} {1}'.format(key, value)
commands.append(command)
elif key == 'timers':
command = 'timers {0} {1}'.format(
proposed['timers_keepalive'],
proposed['timers_holdtime'])
if command not in commands:
commands.append(command)
if (proposed['timers_keepalive'] != PARAM_TO_DEFAULT_KEYMAP.get('timers_keepalive') or
proposed['timers_holdtime'] != PARAM_TO_DEFAULT_KEYMAP.get('timers_holdtime')):
command = 'timers {0} {1}'.format(
proposed['timers_keepalive'],
proposed['timers_holdtime'])
if command not in commands:
commands.append(command)
else:
command = '{0} {1}'.format(key, value)
commands.append(command)
Expand Down Expand Up @@ -437,7 +438,7 @@ def main():
low_memory_exempt=dict(required=False, type='bool'),
maximum_peers=dict(required=False, type='str'),
pwd=dict(required=False, type='str'),
pwd_type=dict(required=False, type='str', choices=['cleartext', '3des', 'cisco_type_7', 'default']),
pwd_type=dict(required=False, type='str', choices=['3des', 'cisco_type_7', 'default']),
remote_as=dict(required=False, type='str'),
remove_private_as=dict(required=False, type='str', choices=['enable', 'disable', 'all', 'replace-as']),
shutdown=dict(required=False, type='bool'),
Expand All @@ -452,7 +453,7 @@ def main():

module = AnsibleModule(
argument_spec=argument_spec,
required_together=[['timers_holdtime', 'timers_keepalive']],
required_together=[['timers_holdtime', 'timers_keepalive'], ['pwd', 'pwd_type']],
supports_check_mode=True,
)

Expand Down
3 changes: 3 additions & 0 deletions test/integration/targets/nxos_bgp_neighbor/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
---
testcase: "*"
vrfs:
- default
- myvrf