Need small help

Hi all,

I am having a issue with copy module copying from localhost to remote server. The problem is when the playbook runs the playbook works fine without any error. But the contents copy_dir_ex is not visible in remote server. I am using ubuntu 14.04.I have provided 777 permission to destination directory. Still i am suspecting it is something pretty silly I am missing. Ansible version is 2.xx

When I run scp command on local hosts it works fine and the contents is available in remote server. Can anyone throw some light what i am missing?

scp -i <private_key> ubuntu@remotehost:/tmp

The code is pretty simple as follows


---

-hosts: all
 gather_facts: false
 become: yes
  tasks:
  - name: Ansible copy directory to the remote server
    copy:
      src:/Users/mdtutorials2/Documents/Ansible/copy_dir_ex
      dest:/Users/mdtutorials2/Documents/Ansible/tmp

Check your “dest” parameter value. From your scp command example, I think you want this to be “/tmp”

  • Sandip

No even if the dest is /tmp the file is not visible in the remote server.

No even if the dest is /tmp the file is not visible in the remote server.

Run our command using “-v” or “—debug” to find out what is happening in that particular task. If you still cannot find out, share the output here.

- Sandip