Reputation: 63
I am trying to use Ansible to copy from one location on a server to another location on the same server, e.g. "cp c:/users/foo c:/users/bar" but cannot find how to do so, or even if it is possible.
Can anyone help?
Upvotes: 1
Views: 2265
Reputation: 61
Use remote_src: True
Example:
- name: Copy a single file where the source is on the remote host
win_copy:
src: C:\temp\foo.txt
dest: C:\ansible\foo.txt
remote_src: True
http://docs.ansible.com/ansible/latest/win_copy_module.html
Upvotes: 1
Reputation: 368
Use the "raw" module and send your command directelly to Powershell:
http://docs.ansible.com/ansible/raw_module.html
Despite it's description, it can be used for windows.
Sérgio
Upvotes: 0