# copy files in the remote machine

**URL:** <https://forum.ansible.com/t/copy-files-in-the-remote-machine/13185>\
**Category:** Ansible Project\
**Created:** [July 24, 2013, 9:20am UTC](https://forum.ansible.com/t/copy-files-in-the-remote-machine/13185 "2013-07-24T09:20:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Perez](https://avatars.discourse-cdn.com/v4/letter/l/aca169/32.png) [@Luis\_Perez](https://forum.ansible.com/u/Luis_Perez)\
**Post date:** [July 24, 2013, 9:20am UTC](https://forum.ansible.com/t/copy-files-in-the-remote-machine/13185/1 "2013-07-24T09:20:59Z")

</div>

Hi,

Is there a way to copy files idempotently in the remote machine (copy a file from one location to another in the same remote machine) ?

The only aproach i can think of is to run two actions: a fetch and then a copy, but I find it a bit ugly. If I use the command or shell modules, then the copy process is not idempotent (or there’s a way to do that?)

Thanks in advance,

Luis

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 24, 2013, 3:04pm UTC](https://forum.ansible.com/t/copy-files-in-the-remote-machine/13185/2 "2013-07-24T15:04:33Z")

</div>

You can do:

shell: rsync …
