Copying files on the remote host

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

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.