If you are not familiar with modules, check out Ansible - Getting Started with Modules.
The synchronize module is used to copy files or directories, and is based off of rsync. The copy can be done locally, meaning a file or directory on a system is copied to some other directory on the same system. Or the copy can be done remotely, meaning the file or directory is copied from (pull) or to (push) a remote system.
In this example, the contents of the /tmp/foo directory on the control node (that's your Ansible system) will be copied to /tmp/foo on each managed node.
---
hosts: all
tasks:
- name: copy /tmp/foo
synchronize:
src: /tmp/foo
dest: /tmp/foo
...
In this example, the /tmp/foo directory on each managed node will be copied to /tmp/foo on server1.example.com. This would be a push (upload / PUT ) operation.
---
hosts: all
tasks:
- name: copy /tmp/foo
synchronize:
src: /tmp/foo
dest: rsync://server1.example.com/tmp/foo
...
In this example, the /tmp/foo directory server1.example.com will be copied to /tmp/foo on each managed node. This would be a pull (download / GET ) operation.
---
hosts: all
tasks:
- name: copy /tmp/foo
synchronize:
src: rsync://server1.example.com/tmp/foo
dest: /tmp/foo
...