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.
- name: Copy files from foo to bar
copy: remote_src=True src=/path/to/foo dest=/path/to/bar
If you want to move file you need to delete old file with file module
- name: Remove old files foo
file: path=/path/to/foo state=absent
From version 2.8 copy module remote_src
supports recursive copying.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…