Why does my Ansible playbook fail when using copy module even when I have enough space on the target

Solution In Progress - Updated -

Issue

When executing a task within a playbook to transfer a large file to a target, the file is "staged" on the target in a location specified by remote_tmp. However, the remote_tmp location is not ideal because it is small and cannot accomodate the file.

This failure will be similar to the following the first time:

 [WARNING]: sftp transfer mechanism failed on [192.168.1.2]. Use
ANSIBLE_DEBUG=1 to see detailed information

 [WARNING]: scp transfer mechanism failed on [192.168.1.2]. Use
ANSIBLE_DEBUG=1 to see detailed information

fatal: [192.168.1.2]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be sent to remote host \"192.168.1.2\". Make sure this host can be reached over ssh", "unreachable": true}

But if the same task is attempted again (without freeing up any space) the message will indicate that there is no space left:

fatal: [192.168.1.2]: UNREACHABLE! => {"changed": false, "msg": "mkdir: cannot create directory ‘/home/ansible/.ansible/tmp/ansible-tmp-1537286773.26-148814310001979’: No space left on device\n", "unreachable": true}

Environment

  • Red Hat Ansible Engine
    • 2.4+

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.