You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to set roles of a user using the Ansible module, the roles are toggled because the roles that are returned from the api have a lower case role value in the objType parameter but the Ansible module generates them with an upper case value for the field:
# That's what wanted_roles looks like
[{'ref': 'roles/10', 'objType': 'Roles', 'name': 'Requesters (built-in)'}, {'ref': 'roles/12', 'objType': 'Roles', 'name': 'DNS Viewers (built-in)'}, {'ref': 'roles/13', 'objType': 'Roles', 'name': 'IPAM Viewers (built-in)'}]
# And this is the role list from a user
[{'ref': 'roles/10', 'objType': 'roles', 'name': 'Requesters (built-in)'}, {'ref': 'roles/12', 'objType': 'roles', 'name': 'DNS Viewers (built-in)'}, {'ref': 'roles/13', 'objType': 'roles', 'name': 'IPAM Viewers (built-in)'}])
Hey @tonk - we're not using Ansible anymore to configure the users as we migrated the central to Windows and SSO. So I can't verify whether this is still correct.
Hey all
When you try to set roles of a user using the Ansible module, the roles are toggled because the roles that are returned from the api have a lower case
role
value in theobjType
parameter but the Ansible module generates them with an upper case value for the field:This then breaks the following member test: https://github.com/menandmice/ansible_micetro/blob/main/plugins/modules/user.py#L336
This can be fixed quick and dirty by changing the objectType to lowercase in the
user.py
IMHO it would be the better approach to only compare role names since this is the primary key and the module only compares roles at this point anyway.
Most likely the same problem exists for groups, which I didn't explicitly test, though.
The text was updated successfully, but these errors were encountered: