Merge pull request #1603 from jumapico/partial

synchronize module: add partial option
reviewable/pr18780/r1
Toshio Kuratomi 10 years ago
commit 658e354db5

@ -152,6 +152,12 @@ options:
default: default:
required: false required: false
version_added: "1.6" version_added: "1.6"
partial:
description:
- Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
default: no
required: false
version_added: "1.9"
notes: notes:
- rsync must be installed on both the local and remote machine. - rsync must be installed on both the local and remote machine.
- Inspect the verbose output to validate the destination user/host/path - Inspect the verbose output to validate the destination user/host/path
@ -237,6 +243,7 @@ def main():
rsync_timeout = dict(type='int', default=0), rsync_timeout = dict(type='int', default=0),
rsync_opts = dict(type='list'), rsync_opts = dict(type='list'),
ssh_args = dict(type='str'), ssh_args = dict(type='str'),
partial = dict(default='no', type='bool'),
), ),
supports_check_mode = True supports_check_mode = True
) )
@ -254,6 +261,7 @@ def main():
compress = module.params['compress'] compress = module.params['compress']
existing_only = module.params['existing_only'] existing_only = module.params['existing_only']
dirs = module.params['dirs'] dirs = module.params['dirs']
partial = module.params['partial']
# the default of these params depends on the value of archive # the default of these params depends on the value of archive
recursive = module.params['recursive'] recursive = module.params['recursive']
links = module.params['links'] links = module.params['links']
@ -332,6 +340,9 @@ def main():
if rsync_opts: if rsync_opts:
cmd = cmd + " " + " ".join(rsync_opts) cmd = cmd + " " + " ".join(rsync_opts)
if partial:
cmd = cmd + " --partial"
changed_marker = '<<CHANGED>>' changed_marker = '<<CHANGED>>'
cmd = cmd + " --out-format='" + changed_marker + "%i %n%L'" cmd = cmd + " --out-format='" + changed_marker + "%i %n%L'"

Loading…
Cancel
Save