How to copy files from src(ansible controller ) to dest ( target hosts)

221 views
Skip to first unread message

Prathap Dasari

unread,
Dec 5, 2020, 9:16:47 PM12/5/20
to Ansible Project
Hi ,

How to copy the zip file size > 250 MB from src(ansible controller )  to dest ( target hosts) ?

I wrote the playbook as below but it didn't working due to my zip file size is more than 700 MB 

- name: Copy files from src(local)  to dest (hosts)

  copy:

    src: "{{ local_source_directory }}/Java8.jre.8.0.0.616.tar"

    dest: "{{ patch_directory }}/"

    force: no


Kindly advise here .. 

Regards,

Prathap

Nuno Jordão

unread,
Dec 5, 2020, 10:12:18 PM12/5/20
to ansible...@googlegroups.com
Hello,

It may be more efficient to store the file in a central http repository and use "get_url" module to copy it to the target machine.

Regards,

Nuno

--
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/2d1a21ee-4fe8-420b-84c7-8692eab190e1n%40googlegroups.com.

Prathap Dasari

unread,
Dec 5, 2020, 10:34:50 PM12/5/20
to ansible...@googlegroups.com
Thank you for your email !!!

Ok , but  just I would like to know if we are able to copy the more 250 MB files to target hosts from ansible controller machine .. If yes , How we can write a task for that ? 

Regards ,
Prathap

Idan Melamed

unread,
Dec 6, 2020, 2:43:58 AM12/6/20
to Ansible Project

Prathap Dasari

unread,
Dec 6, 2020, 2:47:03 AM12/6/20
to Ansible Project
Ho Ida ,

Thank you , I will try and share the result 

Prathap Dasari

unread,
Dec 6, 2020, 3:00:21 AM12/6/20
to Ansible Project
Getting below error ..

TASK [directories : Synchronization of src on the control machine to dest on the remote hosts] ******************************************************************************************************************************************

fatal: [vmpwr0023]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh=/usr/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null --out-format=<<CHANGED>>%i %n%L /u01/ansible/sw/fmw_12.2.1.4.0_infrastructure_Disk1_1of1.zip ora...@172.20.8.90:/u01/staging/patches", "msg": "ssh: connect to host 172.20.8.90 port 22: Connection timed out\r\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(226) [sender=3.1.3]\n", "rc": 255}



This is playbook:


- name: Synchronization of src on the control machine to dest on the remote hosts

  synchronize:

    src: "{{ local_source_directory }}/fmw_12.2.1.4.0_infrastructure_Disk1_1of1.zip"

    dest: "{{ patch_directory }}"

Regards,

Prathap


Dick Visser

unread,
Dec 6, 2020, 4:45:20 PM12/6/20
to ansible...@googlegroups.com
Where does this size limit come from?
I don't recall this being an ansible issue. 
Also you're talking about a zip file while your taks lists a tar file. Those are distinctly different files.
Thirdly what does "it didn't working" mean?
Is that your interpretation of an error?
If so, what is that error?




--
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/2d1a21ee-4fe8-420b-84c7-8692eab190e1n%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

Prathap Dasari

unread,
Dec 6, 2020, 5:57:20 PM12/6/20
to ansible...@googlegroups.com
Hi ,

I would like to copy more than 500 MB files from ansible host to remote host .. kindly suggest me how to do that ?

Regards , 
Prathap

Dick Visser

unread,
Dec 7, 2020, 5:23:40 AM12/7/20
to ansible...@googlegroups.com
Hi
It doesn't work like that.
Please answer the questions first, so we can better understand your problem.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANCC9r%2BgODJw9Q4Jgnv6UipYgbBEAAnmyjiJYH%2BEeap648-pzg%40mail.gmail.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Prathap Dasari

unread,
Dec 7, 2020, 7:00:36 AM12/7/20
to ansible...@googlegroups.com
Hi ‘

I have downloaded that software from oracle site  on my lap to install weblogic  and the file size is more than 500 MB .. 

Regards,
Prathap

Dick Visser

unread,
Dec 7, 2020, 7:24:06 AM12/7/20
to ansible...@googlegroups.com
Still not enough information.
What is the actual problem?


On Mon, 7 Dec 2020 at 13:00, Prathap Dasari <pratha...@gmail.com> wrote:
>
> Hi ‘
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANCC9rKe5OarekfqW7-tWYVrXQpTHLLY_Mw%3DDCFzhDwO9x9CUA%40mail.gmail.com.

Prathap Dasari

unread,
Dec 7, 2020, 7:29:18 AM12/7/20
to ansible...@googlegroups.com
Ok .

I want to transfer the zip files from ansible controller host to target hosts by using ansible but the zip file is more than 500 MB so I am getting timeout errors when trying copy them by using synchronisation model . 

Regards 
Prathap  

Dick Visser

unread,
Dec 7, 2020, 7:59:39 AM12/7/20
to ansible...@googlegroups.com
OK i see the error in one of your previous messages, i didn't spot that.
So there is an issue that prevents large files from being transferred
from your controller to the host, as both the copy and the synchronize
module fail.
This indicates it is not an ansible problem.
So, fix this by taking ansible out of the loop, and debug manually
(using scp or rsync).
Once those work, ansible (which relies on them) will likely work as well.

Dick
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANCC9rK%2Bd5BXEgbO5%2B2B7D8yi1rk-G52UmCB3JEXWBQ71nY6Cg%40mail.gmail.com.

Prathap Dasari

unread,
Dec 7, 2020, 10:24:34 AM12/7/20
to ansible...@googlegroups.com
Ok thank you . Will check a that .. 

tin...@gmail.com

unread,
Dec 7, 2020, 1:27:44 PM12/7/20
to Ansible Project
ssh: connect to host 172.20.8.90 port 22: Connection timed out\r\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(226)

This look like a firewall and/or network routing issue.   Your laptop can not connect to the remote host, 172.20.8.90 at port 22.   Get that working first.

Tin
Reply all
Reply to author
Forward
0 new messages