• Uncategorized

About linux : Copy-from-ansible-empty-folder-on-remote-server-closed

Question Detail

I use ansible for install and setting aplication on linux server.

I can not copy empty folder on remote server.

For example.
I have a folder

test

that contains:

123.conf

log

log is empty folder

I try copy use ansible:

 - name: Copy config test
   copy: src=/home/user/test/ dest=/tmp/test

After executing the script on remote server copied only file 123.conf
If into folder log create file then copied normal.

How copy empty folder use ansible?

Question Answer

  • The version of Ansible you’re using, 1.5, is 4 years old.
  • The more recent Ansible 2.4.3.0 copies empty directories

Therefore the solution is: upgrade Ansible.

(content migrated from comments 1 2)

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.