From bb3a23d40ac37c63ba9e7a80477efefcb9e84e35 Mon Sep 17 00:00:00 2001 From: Aleksey Ovcharenko Date: Fri, 22 Nov 2013 23:59:57 +0200 Subject: [PATCH] Added existing_only options to skip creating new files on receiver --- files/synchronize | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/files/synchronize b/files/synchronize index 9acc4d46628..26e50274be6 100644 --- a/files/synchronize +++ b/files/synchronize @@ -46,6 +46,12 @@ options: choices: [ 'yes', 'no' ] default: 'yes' required: false + existing_only: + description: + - Skip creating new files on receiver. + choices: [ 'yes', 'no' ] + default: 'no' + required: false delete: description: - Delete files that don't exist (after transfer, not before) in the C(src) path. @@ -154,6 +160,7 @@ def main(): private_key = dict(default=None), rsync_path = dict(default=None), archive = dict(default='yes', type='bool'), + existing_only = dict(default='no', type='bool'), dirs = dict(default='no', type='bool'), recursive = dict(type='bool'), links = dict(type='bool'), @@ -174,6 +181,7 @@ def main(): rsync = module.params.get('local_rsync_path', 'rsync') rsync_timeout = module.params.get('rsync_timeout', 'rsync_timeout') archive = module.params['archive'] + existing_only = module.params['existing_only'], dirs = module.params['dirs'] # the default of these params depends on the value of archive recursive = module.params['recursive'] @@ -188,6 +196,8 @@ def main(): cmd = cmd + ' --dry-run' if delete: cmd = cmd + ' --delete-after' + if existing_only: + cmd = cmd + ' --existing' if archive: cmd = cmd + ' --archive' if recursive is False: