I know a lot of people were waiting for this one and wanted to pass along that this is now merged into 1.3 devel.
My testing of it was not comprehensive, I’m sure, so please have at.
Glad to see this one.
I haven’t pushed doc site rebuilds just yet, so here is the output from “ansible-doc synchronize”. I think you will all agree it is some really nice syntax.
[root@localhost ansible]# ansible-doc synchronize
SYNCHRONIZE
This is a wrapper around rsync. Of course you could just use the
command action to call rsync yourself, but you also have to add a
fair number of boilerplate options and host facts. You still may
need to call rsync directly via command' or
shell’ depending on
your use case. The synchronize action is meant to do common things
with `rsync’ easily. It does not provide access to the full power of
rsync, but does make most invocations easier to follow.
Options (= is mandatory):
- delete
Delete files that don’t exist (after transfer, not before) in
the `src’ path. (Choices: yes, no)
= dest
Path on the destination machine that will be synchronized from
the source; The path can be absolute or relative.
-
mode
Specify the direction of the synchroniztion. In push mode the
localhost or delgate is the source; In pull mode the remote
host in context is the source. (Choices: push, pull) -
rsync_path
Specify the rsync command to run on the remote machine. See
`–rsync-path’ on the rsync man page.
= src
Path on the source machine that will be synchronized to the
destination; The path can be absolute or relative.
- verbosity
An integer controlling the amount of information returned
during processing. See the-v, --verbose' option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the
–quiet’ option is passed and
information is supressed.
Synchronization of src on the control machien to dest on the remote hosts
synchronize: src=some/relative/path dest=/some/absolute/path
Synchronization of two paths both on the control machine
local_action: synchronize src=some/relative/path dest=/some/absolute/path
Synchronization of src on the inventory host to the dest on the localhost in
pull mode
synchronize: mode=pull src=some/relative/path dest=/some/absolute/path
Synchronization of src on delegate host to dest on the current inventory host
synchronize: >
src=some/relative/path dest=/some/absolute/path
delegate_to: delegate.host
Synchronize and delete files in dest on the remote host that are not found in src of localhost.
synchronize: src=some/relative/path dest=/some/absolute/path delete=yes
Synchronize and return verbose information from the rsync transfer.
synchronize: src=some/relative/path dest=/some/absolute/path verbosity=1
Synchronize using an alternate rsync command
synchronize: src=some/relative/path dest=/some/absolute/path rsync_path=“sudo rsync”