looping over users?

Does someone have a playbook already that loops over users? I have to generate a report (I’ll give them a CSV file) of users, a description if I can and if the account has access to root (though sudo?)

TIA

Mike

the getent module is probably what you need.
https://docs.ansible.com/ansible/2.9/modules/getent_module.html#getent-module