Ansible: copy a directory content to another directory

Question:

I am trying to copy the content of dist directory to nginx directory.

But when I execute the playbook it throws an error:

How can I copy a directory that has another directory and a file inside?

Answer:

To copy a directory’s content to another directory I use the next:

It copies both items to the other directory. In the example, one of the items is a directory and the other is not. It works perfectly.

Leave a Reply