Closed john-westcott-iv closed 4 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @ptux click here for bot help
Reproduced.
[root@localhost tmp]# pwd
/root/.ansible/tmp
[root@localhost tmp]# ls
[root@localhost tmp]# ls
ansible-tmp-1573402009.7570088-118762426389779
[root@localhost tmp]# tree
.
`-- ansible-tmp-1573402009.7570088-118762426389779
|-- AnsiballZ_copy.py
|-- AnsiballZ_stat.py
`-- source
1 directory, 3 files
[root@localhost tmp]#
resolved_by_pr #65509
@john-westcott-iv, Could you please check PR #65509 and let us know if it works for you ?
Please check How to test a PR for more help.
Thanks.
needs_info
SUMMARY
When using the copy module, if the destination file system does not have enough space the copy fails but the temp file deployed to the server via the copy action plugin remains on the system consuming space.
This appears to be happening in the atomic_move method in module_utils/basic.py.
ISSUE TYPE
COMPONENT NAME
copy
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Red Hat Enterprise Linux release 8.0 (Ootpa) There are two partitions on this machine: /dev/mapper/rhel-root 6.2G 2.0G 4.3G 32% / /dev/sdb1 1017M 1017M 196K 100% /python_scripts
/root/.ansible is on the / partition. The /python_scripts is the destination directory for the file copy.
STEPS TO REPRODUCE
Try to copy a file that is 200k to the /python_scripts directory. The copy action plugin will be able to copy file out to /root/.ansible/tmp/ but the copy module will not be able to move that file to /python_scripts because there is not enough free space. After the playbook ends you can see the left over temp files in /root/.ansible/tmp/.
EXPECTED RESULTS
On error, the copy module will remove the source files.
ACTUAL RESULTS
On remote target:
On controller node:
On remote node:
The tmp directory is left lying around with the 200k file in it.