Skip to content

Commit

Permalink
Resolve username to ID for filetree_create (redhat-cop#806)
Browse files Browse the repository at this point in the history
Co-authored-by: David Danielsson <djdanielsson@users.noreply.github.com>
  • Loading branch information
Tompage1994 and djdanielsson authored Apr 4, 2024
1 parent 389f1dc commit 32a7511
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion roles/filetree_create/tasks/user_roles.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
- name: "Get current Users from the API"
ansible.builtin.set_fact:
user_roles_lookvar: "{{ query(controller_api_plugin, 'api/v2/users/' + (username | urlencode()) + '/roles/',
user_roles_lookvar: "{{ query(controller_api_plugin, 'api/v2/users/' + __user_id + '/roles/',
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs,
return_all=true, max_objects=query_controller_api_max_objects)
}}"
vars:
__user_id: "{{ lookup(controller_api_plugin, 'users', query_params={'username': username}, expect_one=true,
host=controller_hostname, oauth_token=controller_oauthtoken, verify_ssl=controller_validate_certs)['id']
}}"
no_log: "{{ controller_configuration_filetree_create_secure_logging }}"

- name: "Block for to generate flatten output"
Expand Down

0 comments on commit 32a7511

Please # to comment.