help: loop through a remote file

59 views
Skip to first unread message

danish09

unread,
Mar 5, 2021, 12:20:44 PM3/5/21
to Ansible Project
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


Dick Visser

unread,
Mar 5, 2021, 2:06:58 PM3/5/21
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a028e9bb-4b45-4805-a17b-d1953b8fe13an%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

danish09

unread,
Mar 7, 2021, 2:24:15 AM3/7/21
to Ansible Project
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.
Reply all
Reply to author
Forward
0 new messages