# local\_actions: copy contents from stdout issue...LARGE file?

**URL:** <https://forum.ansible.com/t/local-actions-copy-contents-from-stdout-issue-large-file/24812>\
**Category:** Ansible Project\
**Created:** [June 23, 2017, 3:19pm UTC](https://forum.ansible.com/t/local-actions-copy-contents-from-stdout-issue-large-file/24812 "2017-06-23T15:19:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Williams](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jon\_Williams](https://forum.ansible.com/u/Jon_Williams)\
**Post date:** [June 23, 2017, 3:19pm UTC](https://forum.ansible.com/t/local-actions-copy-contents-from-stdout-issue-large-file/24812/1 "2017-06-23T15:19:50Z")

</div>

Hi,

I am using the ‘copy content’ module to grab the contents of a file from an old version of F5 (where the copy / fetch module doesn’t work due to simplejson not being available)

Here is an extract play I have put together:

- name: “Backup BigIP v10 Config”  
raw: ‘!/bin/bash -c “cat /config/bigip.conf”’  
register: bigip10
- local\_action: copy content=“{{ bigip10.stdout }}” dest=“/path/here/{{ inventory\_hostname }}.bigip.conf”

…and this is working for the most part except when the file is LARGE.

The problem is one of the files I want to grab is around 5000 lines and I get the following ‘no descriptive’ error:

TASK [copy] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /path/to/playbooks/f5\_backups.yml:10  
fatal: [XXXXX-XX]: FAILED! =\> {  
“failed”: true,  
“msg”: "{‘stderr’: u’', ‘stdout’:

The only thing I can think is that this must be some sort of buffer error as if I grab a smaller file from the same device - it works a treat.

Before anyone suggests that I need to use the fetch module - I have tried this and it fails with: (even though it says successful!)

XXXXX-XX| SUCCESS =\> {  
“changed”: false,  
“file”: “/config/bigip.conf”,  
“msg”: “unable to calculate the checksum of the remote file”  
}

Oh and the ansible version we are running is 2.2.1.0

Any ideas how to get to the bottom of / solve this will be gratefully received!

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [June 27, 2017, 5:27pm UTC](https://forum.ansible.com/t/local-actions-copy-contents-from-stdout-issue-large-file/24812/2 "2017-06-27T17:27:45Z")

</div>

If the equipment support sftp, scp, ftp or some other transfer protocol maybe just use that.

---

<div class="post-metadata">

**Author:** ![Jon\_Williams](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jon\_Williams](https://forum.ansible.com/u/Jon_Williams)\
**Post date:** [June 30, 2017, 1:52pm UTC](https://forum.ansible.com/t/local-actions-copy-contents-from-stdout-issue-large-file/24812/3 "2017-06-30T13:52:05Z")

</div>

Thanks…Whilst it does support those protocols, we cannot use those due to being unable to do password-less logins via SSH keys. Also, we can only connect to these devices on those protocols - we cannot go outbound from these devices to other servers.

I have managed to script this in raw ansible commands I was kind of hoping we could use Ansible playbooks to make this more manageable in the future.
