- name: Copy data to the client machine
hosts: hostname
become_method: sudo
become_user: root
become: true
tasks:
# Copy twice as sometimes files get skipped (mostly only one file skipped from a folder if the folder does not exist)
- name: Copy UFO-Server
copy:
src: "source files path"
dest: "destination file path"
owner: root
group: root
mode: 0644
backup: yes
ignore_errors: true
- name: Copy Multiple Files on remote Hosts
ansible.windows.win_copy:
src: "\{\{ srcPath }}/\{\{ item }}" # Remeber to us \{\{item}}
# as a postfix to source path
dest: "\{\{ destPath }}"
remote_src: yes # if source path is available on remote Host
with_items:
- abc.txt
- abc.properties