#netapp.storagegrid.na_sg_org_user, dont validate groups.

1 messages · Page 1 of 1 (latest)

dreamy pine
#

Hello, we found out that the module responds ok as long as user exist, but dont validate groups attached to it.
If there is abetter way of doing please let me know.

( i did test with the latest collection also. )

dreamy pine
#

seems it might be only if users dont have any groups. we are looking more into it.

dreamy pine
#

we done some more testing. and we narrowed it down to be if a user dont have any groups the module will not add any even if they are defined.

dreamy pine
#

should i post some code ? how can i help and what else would be good if i did ?

scarlet gorge
#

Hi @dreamy pine , Yes please post the task to get better idea

dreamy pine
#
  • name: "create a normal user"
    netapp.storagegrid.na_sg_org_user:
    api_url: "https://s3.fohm.local/"
    auth_token: "{{ auth.json.data }}"
    validate_certs: false
    state: "{{ state }}"
    full_name: "{{ user }}"
    unique_name: "user/{{ user }}"
    password: "{{ lookup('ansible.builtin.password', '/dev/null', seed=inventory_hostname) }}"
    member_of: "{{ ['group/'] | product(lookup('list_bucket', (full_user|default(user)), env, wantlist=True)) | map('join') | list }}"
    disable: false
    #update_password: always # need to be changed

the lookup where needed before with the prev structure we used to define buckets,groups and users,
it returns per user a list with what groups a users should be in.
example: "['group/svebar-acc-sh-wo']"

#

so the issue is that if users exist , and have no groups attached. this will not add any groups but if the user have 1 or more groups it will add any new ones .

scarlet gorge
#

Thank you for providing the task, I will let you know

dreamy pine
#

@scarlet gorge thank you, please let me know if there is anything i can assist with.

scarlet gorge
#

Thanks for reporting this. it seems like bug, we have created internal story 7440 for this.

dreamy pine
#

Hi, been looking on the code.
and is seems its a simple fix.
in na_sg_org_user.py
line 261 and 262 is the reason.

#

i would remove line 263 and fix indenteation and it should work just fine