Ansible for download the files from FTP -


currently, i'm using shell script download files ftp server. ansible execute script , continue other automated jobs.

please let me know best way in ansible playbook using "get_url" instead of "shell". following syntax working download single file requirements download multiple files , directories.

appreciated help.

- name: ftp download   get_url: url=ftp://username:password@ftp.server.com/2016/03/value/myfile dest=/home/user/03/myfile1   register: get_url_result 

according get_url documentation, , far know, get_url not support recursive download.

one possibility, @hellov suggested, loop through list with_items. require have static list of files or obtain list somehow, wget.

consequently, use wget -m directly in order recursively download files 1 task. see how recursively download folder via ftp on linux.


Comments