Ansible: copy a directory content to another directory
<p>I am trying to copy the content of dist directory to nginx directory.</p>

<pre><code>- name: copy html file
  copy: src=/home/vagrant/dist/ dest=/usr/share/nginx/html/
</code></pre>

<p>But when I execute the playbook it throws an error:</p>

<pre><code>TASK [NGINX : copy html file] **************************************************
fatal: [172.16.8.200]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "attempted to take checksum of directory:/home/vagrant/dist/"}
</code></pre>

<p>How can I copy a directory that has another directory and a file inside?</p>