How is it possible to move/rename a file/directory using an Ansible module on a remote system? I don't want to use the command/shell tasks and I don't want to copy the file from the local system to the remote system.
How to move/rename a file using an Ansible task on a remote system
ansible
Related Topic
- WPF textbox binding issue
- Linux – How to set Linux environment variables with Ansible
- Python – Abort HTMLParser processing in Python
- Python – How to tell if a full-screen application is running
- Ansible: read remote file
- JQuery image grid effect
- Javascript – IE8 will report error about for in without declaring var item
- Ansible: How to copy files remote to remote
Best Answer
From version 2.0, in copy module you can use
remote_src
parameter.If
True
it will go to the remote/target machine for the src.If you want to move file you need to delete old file with file module
From version 2.8 copy module
remote_src
supports recursive copying.