# looping over users?

**URL:** <https://forum.ansible.com/t/looping-over-users/35630>\
**Category:** Ansible Project\
**Created:** [August 17, 2021, 3:11pm UTC](https://forum.ansible.com/t/looping-over-users/35630 "2021-08-17T15:11:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Eggleston](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mike\_Eggleston](https://forum.ansible.com/u/Mike_Eggleston)\
**Post date:** [August 17, 2021, 3:11pm UTC](https://forum.ansible.com/t/looping-over-users/35630/1 "2021-08-17T15:11:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [August 17, 2021, 3:56pm UTC](https://forum.ansible.com/t/looping-over-users/35630/2 "2021-08-17T15:56:16Z")

</div>

the getent module is probably what you need.  
[https://docs.ansible.com/ansible/2.9/modules/getent\_module.html#getent-module](https://docs.ansible.com/ansible/2.9/modules/getent_module.html#getent-module)
