How to copy directory from remote machine to ansible machine

19 views
Skip to first unread message

amit ahuja

unread,
Apr 3, 2019, 7:08:42 AM4/3/19
to ansible...@googlegroups.com
Hi,

i want to know if there is any way to copy complete directory from remote machine to local ansible machine . i tried to used fetch method but it is  copying files with complete path which i dont want . pls help .

thanks
Amit


Vinu Vajravel

unread,
Apr 3, 2019, 7:39:53 AM4/3/19
to ansible...@googlegroups.com
SCP you tried ? 

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMW2Xdf2Fh81YHh_C%3DiQ3%2BTk41eSScd4Pm5JTAgc4%2BBNr8LuxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Tony Chia

unread,
Apr 3, 2019, 9:45:25 AM4/3/19
to Ansible Project
If you don't want the complete path, you can set "flat: yes" in the fetch task and it will flatten the directory for you.

--Tony

Brian Coca

unread,
Apr 3, 2019, 3:46:50 PM4/3/19
to Ansible Project
https://docs.ansible.com/ansible/latest/modules/synchronize_module.html
see 'mode' specifically the 'pull' value

--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages