From 21f0c0f42f336e31ff87bd04f97896f8f7c150a6 Mon Sep 17 00:00:00 2001 From: Simon Dodsley Date: Tue, 27 Aug 2019 18:00:25 -0400 Subject: [PATCH] Change references to ansible_facts (#61353) --- .../61353-purefa_user_change_facts_to_user_info.yaml | 2 ++ lib/ansible/modules/storage/purestorage/purefa_user.py | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/61353-purefa_user_change_facts_to_user_info.yaml diff --git a/changelogs/fragments/61353-purefa_user_change_facts_to_user_info.yaml b/changelogs/fragments/61353-purefa_user_change_facts_to_user_info.yaml new file mode 100644 index 00000000000..b2a4c09fd80 --- /dev/null +++ b/changelogs/fragments/61353-purefa_user_change_facts_to_user_info.yaml @@ -0,0 +1,2 @@ +minor_changes: + - purefa_user - change resulting fact dict from I(ansible_facts) to I(user_info) (https://github.com/ansible/ansible/pull/61353) diff --git a/lib/ansible/modules/storage/purestorage/purefa_user.py b/lib/ansible/modules/storage/purestorage/purefa_user.py index 6f8ff0dc836..c948eecc82d 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_user.py +++ b/lib/ansible/modules/storage/purestorage/purefa_user.py @@ -63,9 +63,10 @@ EXAMPLES = r''' api: true fa_url: 10.10.10.2 api_token: e31060a7-21fc-e277-6240-25983c6c4592 + register: result debug: - msg: "API Token: {{ ansible_facts['api_token'] }}" + msg: "API Token: {{ result['user_info']['user_api'] }}" - name: Change role type for existing user purefa_user: @@ -90,9 +91,10 @@ EXAMPLES = r''' state: update fa_url: 10.10.10.2 api_token: e31060a7-21fc-e277-6240-25983c6c4592 + register: result debug: - msg: "API Token: {{ ansible_facts['user_api'] }}" + msg: "API Token: {{ result['user_info']['user_api'] }}" ''' RETURN = r''' @@ -171,7 +173,7 @@ def create_user(module, array): module.fail_json(msg='Local User {0}: Role changed failed'.format(module.params['name'])) if passwd_changed or role_changed or api_changed: changed = True - module.exit_json(changed=changed, ansible_facts=user_token) + module.exit_json(changed=changed, user_info=user_token) def delete_user(module, array):