# Copying files on the remote host

**URL:** <https://forum.ansible.com/t/copying-files-on-the-remote-host/19559>\
**Category:** Ansible Project\
**Created:** [October 20, 2015, 10:02am UTC](https://forum.ansible.com/t/copying-files-on-the-remote-host/19559 "2015-10-20T10:02:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![brentgclarklist](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@brentgclarklist](https://forum.ansible.com/u/brentgclarklist)\
**Post date:** [October 20, 2015, 10:02am UTC](https://forum.ansible.com/t/copying-files-on-the-remote-host/19559/1 "2015-10-20T10:02:13Z")

</div>

Good day Guys

How do I got about copying files on the remote host?

My client up loads the cert in /srv, and I need ansible to copy it.

This is what I got:

- name: copy SSL key domain.key  
command: creates=“{{ ssl\_cert\_dir }}/domain.key” cp “{{ ssl\_cert\_dir }}/domain.key” /etc/apache2/ssl/key/  
notify:
- restart apache2

Thanks  
Brent

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 20, 2015, 12:54pm UTC](https://forum.ansible.com/t/copying-files-on-the-remote-host/19559/2 "2015-10-20T12:54:40Z")

</div>

in 2.0 the copy module supports remote\_src=true to copy files to/from  
the remote target

in 1.x what you've got or the synchronize module.
