daicky777
daicky777

Reputation: 103

How can i move all files in a directory to another using Ansible module?

if you're going to move ALL files in a certain folder to another using Ansible, you would use the command module something like:

command: mv /home/user/boxA/* /var/www/boxB/

But it occurred an stderr saying you cannot move the "/home/user/boxA/*".

I think it should be an easier findable solution .

Thanks.

Upvotes: 5

Views: 12556

Answers (1)

Andrew
Andrew

Reputation: 4632

You should use shell module instead of command to use globbing.

shell: mv /home/user/boxA/* /var/www/boxB/

Upvotes: 9

Related Questions