From 0d5f083a5289bb7c43c9e7522974f260b7241e00 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Tue, 29 Jan 2019 02:34:27 +0100 Subject: [PATCH] aci_aaa_user: Fix changing user description This fixes a reported problem with the aci_aaa_user module. --- .../fragments/51406-aci_aaa_user-description.yaml | 2 ++ lib/ansible/modules/network/aci/aci_aaa_user.py | 1 + test/integration/targets/aci_aaa_user/tasks/main.yml | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 changelogs/fragments/51406-aci_aaa_user-description.yaml diff --git a/changelogs/fragments/51406-aci_aaa_user-description.yaml b/changelogs/fragments/51406-aci_aaa_user-description.yaml new file mode 100644 index 00000000000..61404728912 --- /dev/null +++ b/changelogs/fragments/51406-aci_aaa_user-description.yaml @@ -0,0 +1,2 @@ +bugfixes: +- aci_aaa_user - Fix setting user description (https://github.com/ansible/ansible/issues/51406) diff --git a/lib/ansible/modules/network/aci/aci_aaa_user.py b/lib/ansible/modules/network/aci/aci_aaa_user.py index 38c1faeb3d4..3cf81784306 100644 --- a/lib/ansible/modules/network/aci/aci_aaa_user.py +++ b/lib/ansible/modules/network/aci/aci_aaa_user.py @@ -319,6 +319,7 @@ def main(): class_config=dict( accountStatus=enabled, clearPwdHistory=clear_password_history, + descr=description, email=email, expiration=expiration, expires=expires, diff --git a/test/integration/targets/aci_aaa_user/tasks/main.yml b/test/integration/targets/aci_aaa_user/tasks/main.yml index a707b25af84..46b2af238ef 100644 --- a/test/integration/targets/aci_aaa_user/tasks/main.yml +++ b/test/integration/targets/aci_aaa_user/tasks/main.yml @@ -66,8 +66,10 @@ that: - cm_add_user is changed - nm_add_user is changed + - nm_add_user.current.0.aaaUser.attributes.descr == 'Ansible test user' - cm_add_user_again is not changed - nm_add_user_again is not changed + - nm_add_user_again.current.0.aaaUser.attributes.descr == 'Ansible test user' # MODIFY USER @@ -107,8 +109,10 @@ that: - cm_modify_user is changed - nm_modify_user is changed + - nm_modify_user.current.0.aaaUser.attributes.descr == 'Ansible test user for integration tests' - cm_modify_user_again is not changed - nm_modify_user_again is not changed + - nm_modify_user_again.current.0.aaaUser.attributes.descr == 'Ansible test user for integration tests' # QUERY ALL USERS @@ -157,6 +161,12 @@ - cm_query_user is not changed - nm_query_user is not changed - cm_query_user == nm_query_user + - nm_query_user.current.0.aaaUser.attributes.accountStatus == 'active' + - nm_query_user.current.0.aaaUser.attributes.descr == 'Ansible test user for integration tests' + - nm_query_user.current.0.aaaUser.attributes.email == 'aci-ansible@ansible.lan' + - nm_query_user.current.0.aaaUser.attributes.expiration == '2123-12-12T00:00:00.000+00:00' + - nm_query_user.current.0.aaaUser.attributes.expires == 'yes' + - nm_query_user.current.0.aaaUser.attributes.phone == '2-345-555-678' # REMOVE USER