# copy module suggestions

**URL:** <https://forum.ansible.com/t/copy-module-suggestions/12190>\
**Category:** Ansible Project\
**Created:** [January 8, 2013, 6:52pm UTC](https://forum.ansible.com/t/copy-module-suggestions/12190 "2013-01-08T18:52:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oren\_Shomron](https://avatars.discourse-cdn.com/v4/letter/o/df705f/32.png) [@Oren\_Shomron](https://forum.ansible.com/u/Oren_Shomron)\
**Post date:** [January 8, 2013, 6:52pm UTC](https://forum.ansible.com/t/copy-module-suggestions/12190/1 "2013-01-08T18:52:40Z")

</div>

Hi everyone,

I have two suggestions for the copy module:

1. Often times I have to copy a file for the sole purpose of running a command on it, for example copying a .deb package or .tar.gz file and then installing it. The file is only needed temporarily. Currently, I need to create the target directory, copy the file, run the command, only\_if the file has changed, remove it, etc. Would it make sense to wrap all this up in a kind of “command\_with\_file” module?

2. Is it true that the copy module always copies the file over before running md5 to see if it is actually necessary to transfer over? This won’t scale very well for me for large files/large deployments. Is it possible to tweak this behavior?

Let me know what you think.

Thanks!

- Oren

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [January 8, 2013, 7:50pm UTC](https://forum.ansible.com/t/copy-module-suggestions/12190/2 "2013-01-08T19:50:35Z")

</div>

> Hi everyone,
> 
> I have two suggestions for the copy module:
> 
> 1. Often times I have to copy a file for the sole purpose of running a  
> command on it, for example copying a .deb package or .tar.gz file and then  
> installing it. The file is only needed temporarily. Currently, I need to  
> create the target directory, copy the file, run the command, only\_if the  
> file has changed, remove it, etc. Would it make sense to wrap all this up in  
> a kind of "command\_with\_file" module?

Sounds a little confusing

but it might be nice to have something like an 'on\_success' notify  
that could delete files.

> 2. Is it true that the copy module always copies the file over before  
> running md5 to see if it is actually necessary to transfer over? This won't  
> scale very well for me for large files/large deployments. Is it possible to  
> tweak this behavior?

it's not true
