fixed nxos_aaa_server_host issue with type 7 encrypt key (#46015)
* fixed nxos_aaa_server_host issue with type 7 encrypt and added test cases * added idempotence tests
This commit is contained in:
parent
c11c3506cd
commit
f20938788a
3 changed files with 49 additions and 0 deletions
|
@ -309,6 +309,8 @@ def main():
|
|||
delta = proposed
|
||||
else:
|
||||
for key, value in proposed.items():
|
||||
if key == 'encrypt_type':
|
||||
delta[key] = value
|
||||
if value != existing.get(key):
|
||||
if value != 'default' or existing.get(key):
|
||||
delta[key] = value
|
||||
|
|
|
@ -130,6 +130,30 @@
|
|||
|
||||
- assert: *false
|
||||
|
||||
- name: "Configure radius server with new type 7 encryption key"
|
||||
nxos_aaa_server_host: &configure_radius_new_type7
|
||||
server_type: radius
|
||||
address: 8.8.8.8
|
||||
host_timeout: 25
|
||||
auth_port: 2083
|
||||
acct_port: 2084
|
||||
encrypt_type: 7
|
||||
key: helloback
|
||||
provider: "{{ connection }}"
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'key 7' in result.updates[0]"
|
||||
|
||||
- name: "Check Idempotence"
|
||||
nxos_aaa_server_host: *configure_radius_new_type7
|
||||
register: result
|
||||
|
||||
- assert: *false
|
||||
|
||||
- name: "Configure radius server with default key"
|
||||
nxos_aaa_server_host: &configure_radius_defkey
|
||||
server_type: radius
|
||||
|
|
|
@ -133,6 +133,29 @@
|
|||
|
||||
- assert: *false
|
||||
|
||||
- name: "Configure tacacs server with new type 7 encryption key"
|
||||
nxos_aaa_server_host: &configure_tacacs_new_type7
|
||||
server_type: tacacs
|
||||
address: 8.8.8.8
|
||||
host_timeout: 25
|
||||
tacacs_port: 89
|
||||
encrypt_type: 7
|
||||
key: helloback
|
||||
provider: "{{ connection }}"
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'key 7' in result.updates[0]"
|
||||
|
||||
- name: "Check Idempotence"
|
||||
nxos_aaa_server_host: *configure_tacacs_new_type7
|
||||
register: result
|
||||
|
||||
- assert: *false
|
||||
|
||||
- name: "Configure tacacs server with default key"
|
||||
nxos_aaa_server_host: &configure_tacacs_defkey
|
||||
server_type: tacacs
|
||||
|
|
Loading…
Reference in a new issue