synchronize
Collection: posix
Full Name: parallax.posix.synchronize
Aliases: ansible.posix.synchronize, synchronize
Controller module — runs on the local controller, not on remote hosts.
Synopsis
Manage synchronize
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| src | string | yes | Path on the source host that will be synced to the destination | |
| dest | string | yes | Path on the destination host that will be synced from the source | |
| mode | string | push | Sync mode: push copies from controller to remote, pull copies from remote to controller | |
| archive | bool | true | Mirrors the rsync flag –archive to enable recursive, links, perms, times, owner, group flags | |
| checksum | bool | false | Skip based on checksum rather than mod-time and size | |
| compress | bool | true | Compress file data during transfer | |
| delete | bool | false | Delete files in dest that do not exist in src | |
| dirs | bool | false | Transfer directories without recursing | |
| existing_only | bool | false | Skip creating new files on the receiver | |
| links | bool | true | Copy symlinks as symlinks | |
| recursive | bool | true | Recurse into directories | |
| rsync_opts | []string | Additional rsync options to pass as a list | ||
| rsync_path | string | Path to rsync command on the remote host | ||
| rsync_timeout | string | 0 | Timeout for the rsync command in seconds | |
| ssh_args | string | Additional SSH arguments to pass to rsync | ||
| private_key | string | Path to the private key file for SSH connections | ||
| verify_host | bool | false | Verify host key of the destination machine | |
| set_remote_user | bool | true | Put user@ for the remote paths | |
| partial | bool | false | Keep partially transferred files | |
| copy_links | bool | false | Copy referent of symlinks as files/dirs | |
| times | bool | true | Preserve modification times | |
| owner | bool | true | Preserve owner | |
| group | bool | true | Preserve group | |
| perms | bool | true | Preserve permissions |
Example
- name: Example synchronize task
synchronize:
src: <your_src>
dest: <your_dest>