title: Why does the ansible remote copy not work from local
body: <p>I just started learning ansible and writing first <code>copy</code> module but i am clueless why its not working.</p>
  
  <pre><code>---
   - hosts: osa
     tasks:
       - name: Copying file to remote host
         copy: src=/tmp/foo.txt dest=/tmp/bar.txt
  </code></pre>
  
  <p>Ran playbook but nothing happened and no error too. </p>
  
  <pre><code># /usr/bin/ansible-playbook /home/spatel/ansible/first-playbook.yml
  
  PLAY [osa] **************************************************************************************************************************************************************************
  
  TASK [Gathering Facts] **************************************************************************************************************************************************************
  ok: [10.5.1.160]
  
  TASK [Copying file to remote host] **************************************************************************************************************************************************
  ok: [10.5.1.160]
  
  PLAY RECAP **************************************************************************************************************************************************************************
  10.5.1.160                 : ok=2    changed=0    unreachable=0    failed=0
  </code></pre>
  
  <p>My /etc/ansible/hosts file has <strong>Remote</strong> host IP address:</p>
  
  <pre><code>[osa]
  10.5.1.160
  </code></pre>
  
  <p>Verbose output:</p>
  
  <pre><code># ansible-playbook -vv first-playbook.yml
  ansible-playbook 2.4.1.0
    config file = /etc/ansible/ansible.cfg
    configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/site-packages/ansible
    executable location = /usr/bin/ansible-playbook
    python version = 2.7.5 (default, Nov  6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
  Using /etc/ansible/ansible.cfg as config file
  
  PLAYBOOK: first-playbook.yml ********************************************************************************************************************************************************
  1 plays in first-playbook.yml
  
  PLAY [osa] **************************************************************************************************************************************************************************
  META: ran handlers
  
  TASK [Copying file to remote host] **************************************************************************************************************************************************
  task path: /home/spatel/ansible/first-playbook.yml:5
  ok: [10.5.1.160] =&gt; {"changed": false, "checksum": "4383f040dc0303e55260bca327cc0eeb213b04b5", "failed": false, "gid": 0, "group": "root", "mode": "0644", "owner": "root", "path": "/tmp/bar.txt", "secontext": "unconfined_u:object_r:admin_home_t:s0", "size": 8, "state": "file", "uid": 0}
  META: ran handlers
  META: ran handlers
  
  PLAY RECAP **************************************************************************************************************************************************************************
  10.5.1.160                 : ok=1    changed=0    unreachable=0    failed=0
  </code></pre>
  
  <h1>UPDATE</h1>
  
  <p>I have noticed its copying file to localhost <strong>not</strong> remote host, this makes no sense, why is it saying in the output that it is executing the playbook on the remote host (10.5.1.160) ?????</p>
  
  <pre><code># ls -l /tmp/bar.txt
  -rw-r--r--. 1 root root 16 May 24 10:45 /tmp/bar.txt
  </code></pre>