# Copy Module Question

**URL:** <https://forum.ansible.com/t/copy-module-question/27714>\
**Category:** Ansible Project\
**Created:** [June 5, 2018, 9:29pm UTC](https://forum.ansible.com/t/copy-module-question/27714 "2018-06-05T21:29:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlton\_Patterson1](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@Carlton\_Patterson1](https://forum.ansible.com/u/Carlton_Patterson1)\
**Post date:** [June 5, 2018, 9:29pm UTC](https://forum.ansible.com/t/copy-module-question/27714/1 "2018-06-05T21:29:08Z")

</div>

Hello Community,

I’m learning Ansible and I’m looking at the Copy module.

While the copy module is pretty straightforward the module doesn’t show how to specify the source machine and destination. For example, the following Copy scenario specifies src of /srv/myfiles/foo.conf and destination of /etc/foo.conf. But how would I specify the ip address, name etc of the source machine, and destination name, ip address etc of the destination machine?

```auto
- name: example copying file with owner and permissions
  copy:
    src: /srv/myfiles/foo.conf
    dest: /etc/foo.conf
    owner: foo
    group: foo
    mode: 0644

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [June 5, 2018, 11:29pm UTC](https://forum.ansible.com/t/copy-module-question/27714/2 "2018-06-05T23:29:53Z")

</div>

the source machine is the one  
​executing ansible, the copy module has a remote\_src=no|yes option that allows you to switch the src to come from the target machien, but there are no options to use a 3rd machine.

For copying from HostA to HostB via your machine you need to copy the file locally from HostA (fetch module) and then copy to HostB.
