help: loop through a remote file

Hi,

Using ansible 2.4.0 on controller.

Remote is an ubuntu 14.04 LTS.

Python 2.7

I am trying to cat through passwd file, awk the first column, register that into a variable and then create a compressed archive of a remote dir based on that username.

I have read about using lookups, simple shell module, slurp but I cannot figure out how to do this on the remote host.

Can you please help me out with this?

Do let me know if you need any further information.

Thanks

Danish

Did you look at
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/getent_module.html ?

Thanks Dick. I managed to get it working with the shell command. Im not sure is using the getent module, I would have been able to loop through it though. From what I read it seemed to lookup usernames and other data related to a particular key/user.

Thanks though.