diff --git a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py index 0c1d6bc6f4..c1a84814b6 100644 --- a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py +++ b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py @@ -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 diff --git a/test/integration/targets/nxos_aaa_server_host/tests/common/radius.yaml b/test/integration/targets/nxos_aaa_server_host/tests/common/radius.yaml index c00a43a4b1..1f73efde1b 100644 --- a/test/integration/targets/nxos_aaa_server_host/tests/common/radius.yaml +++ b/test/integration/targets/nxos_aaa_server_host/tests/common/radius.yaml @@ -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 diff --git a/test/integration/targets/nxos_aaa_server_host/tests/common/tacacs.yaml b/test/integration/targets/nxos_aaa_server_host/tests/common/tacacs.yaml index c5ca89785a..d493fe19ca 100644 --- a/test/integration/targets/nxos_aaa_server_host/tests/common/tacacs.yaml +++ b/test/integration/targets/nxos_aaa_server_host/tests/common/tacacs.yaml @@ -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