I am running into the limitations of ansible fetch module. Trying to get a somewhat big file – between 1MB and 250MB – which is chearly too much for fetch.
- name: get result files back
fetch:
src: /tmp/file_generated_previous_step.tar.gz
dest: file_generated_{{ inventory_hostname }}.tar.gz
flat: yes
This works when my result file is small, but gives a looooong error when the file is about 1-2MB.
My workaround is to scp the file from the controlling host, like this:
- name: get result files back
shell: ' scp {{ inventory_hostname }}:/tmp/file_generated_previous_step.tar.gz file_generated_{{ inventory_hostname }}.tar.gz'
delegate_to: localhost
This is working ok, when I have pubkey auth with no password to the host. But has no error handling, whatsoever.
So my question is: is there a correct method to achieve the same result? Constraint: Ansible 2.4
Best regards,
Trifo