local_actions: copy contents from stdout issue...LARGE file?

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!

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

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.