dell / ansible-powerscale

PowerScale (Isilon) Ansible modules
GNU General Public License v3.0
29 stars 21 forks source link

[BUG]: In module user: task to find user apparently tries to create the user #109

Closed nikolisg7 closed 1 month ago

nikolisg7 commented 2 months ago

Describe the bug I am using a task identical to the example task from the user module to assess if a ADS user exists:

- name: Get User Details using user name
  dellemc.powerscale.user:
    onefs_host: "{{onefs_host}}"
    port_no: "{{port_no}}"
    api_user: "{{api_user}}"
    api_password: "{{api_password}}"
    verify_ssl: "{{verify_ssl}}"
    access_zone: "{{access_zone}}"
    provider_type: ads
    user_name: gavagai
    state: "present"

Upon execution I am receiving the following error:

FAILED! => {"changed": false, "msg": "Unable to create a user, 'password' is missing"}

To Reproduce Steps to reproduce the behavior:

  1. Create the task as above
  2. Run the task on a cluster with configured ads Step n See error

Expected behavior If user exists in zone: JSON response with user details, the ones returned from GET /platform/auth/users/USER If user does not exist in zone: error response similar to the API:

{
"errors" : 
[

{
"code" : "AEC_NOT_FOUND",
"message" : "Failed to find user for 'USER:gavagai': No such user"
}
]
}

Screenshots If applicable, add screenshots to help explain your problem.

Logs If applicable, submit logs or stack traces from the affected services

System Information (please complete the following information):

Additional context I wouldn't mind to use direct API queries to get user information, if the user module doesn't support it. Perhaps then the documentation/examples in the user module should be updated

sachin-apa commented 1 month ago

@nikolisg7 Ansible recommends to use info module to fetch the info and use configuration modules to configure. We have fixed the info module to return the paginated data, Please use Info module to fetch the user details.