# error handling on this seems a little aggressive?
# error handling on this seems a little aggressive?
ifresult['rc']!=0:
ifresult['rc']!=0:
output='could not create temporary directory, SSH (%s) exited with result %d'%(cmd,result['rc'])
ifresult['rc']==5:
output='Authentication failure.'
else:
output='Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: %s, exited with result %d'%(cmd,result['rc'])
short_description: An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy.
short_description: Uses rsync to make synchronizing file paths in your playbooks quick and easy.
description:
description:
- An Ansible action plugin using rsync to make synchronizing a file paths in your playbooks quick and easy. 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 C(command) or C(shell). The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync.
- 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 C(command) or C(shell) depending on your use case. The synchronize action is meant to do common things with C(rsync) easily. It does not provide access to the full power of rsync, but does make most invocations easier to follow.
options:
options:
src:
src:
description:
description:
- Path on the source machine that will be synchronized to the destination; The path can be absolute or relative.
- Path on the source machine that will be synchronized to the destination; The path can be absolute or relative.
required: true
required: true
default: null
dest:
dest:
description:
description:
- Path on the destination machine that will be synchronized from the source; The path can be absolute or relative.
- Path on the destination machine that will be synchronized from the source; The path can be absolute or relative.
required: true
required: true
default: null
mode:
mode:
description:
description:
- Specify the direction of the synchroniztion. In push mode the localhost or delgate is the source; In pull mode the inventory hostname in context is the source.
- 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.
required: false
required: false
choices: [ 'push', 'pull' ]
choices: [ 'push', 'pull' ]
default: 'push'
default: 'push'
verbosity:
verbosity:
description:
description:
- An integrater controling the amount of information returned during processing. The greater the value the more information rsync will report back. See the C(-v, --verbose) option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the C(--quiet) option is passed and information is supressed.
- An integer controlling the amount of information returned during processing. See the C(-v, --verbose) option of the rsync man page for details. If verbosity is not defined or a value of 0 is assumed, the C(--quiet) option is passed and information is supressed.
required: false
required: false
default: 0
default: 0
delete:
delete:
description:
description:
- Delete files that don't exist (after transfer, not before) in C(src) path.
- Delete files that don't exist (after transfer, not before) in the C(src) path.
choices: [ 'yes', 'no' ]
choices: [ 'yes', 'no' ]
default: 'no'
default: 'no'
required: false
required: false
rsync_path:
rsync_path:
description:
description:
- Specify rsync to run on the remote machine. See C(--rsync-path) on the rsync man page.
- Specify the rsync command to run on the remote machine. See C(--rsync-path) on the rsync man page.